Local name resolution is done via /etc/hosts file. If you have small network then use /etc/hosts file. DNS (domain name service is accountable for associating domain names with ip address, for example domain yahoo.com is easy to remember than IP address 202.66.66.12) provides better name resolution. To configure FreeBSD as DNS client you need to edit or modify /etc/resolv.conf file. This file defines which name servers to use.
Steps to configure FreeBSD as DNS client
1) Login as a root user
$ su -
2) Open /etc/resolv.conf file using text editor
# vi /etc/resolv.conf
3) Add ISP nameserver as follows:
search isp.com nameserver 202.54.1.110 nameserver 202.54.1.112 nameserver 202.54.1.115
Note Max. three nameserver can be used/defined at a time.
4) Save file
5) Test dns using ping, dig or nslookup commands:
$ dig www.cyberciti.biz $ dig mx google.com $ dig a yahoo.com $ nslookup nixcraft.com $ ping www.cyberciti.biz
OR
Use browser to browse Internet.
See also:
- How do I improve DNS performance on Linux/Windows Desktop (if you are using Linux/FreeBSD as a Router)
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |