FreeBSD > How to setup FreeBSD as DNS client?

in Categories News last updated December 1, 2004

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 is easy to remember than IP address 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:


Note Max. three nameserver can be used/defined at a time.

4) Save file

5) Test dns using ping, dig or nslookup commands:

$ dig
$ dig mx
$ dig a
$ nslookup
$ ping

Use browser to browse Internet.

See also:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):