How to setup FreeBSD as DNS client?

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
180.131.144.144
180.131.145.145

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

4) Save file

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

$ dig mx google.com
$ dig a yahoo.com
$ nslookup nixcraft.com
$ ping www.cyberciti.biz
$ ping http://www.nawala.org/

OR
Use browser to browse Internet.

 

Repost from here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s