Linux / UNIX setting DNS directives

nder Linux / UNIX / BSD operating system, you need to edit the /etc/resolv.conf file and add the line:

nameserver {IP-OF-THE-DNS-1}
nameserver {IP-OF-THEISP-DNS-SERVER-2}

Login as the root, enter:
# vi /etc/resolv.conf
OR
$ sudo vi /etc/resolv.conf
Modify or enter nameserver as follows:
nameserver {IP-OF-THE-DNS-1}
nameserver {IP-OF-THEISP-DNS-SERVER-2}

Save and close the file. To test DNS configuration type any one of the following command:
$ host google.com
$ dig google.com
$ ping google.com
$ nslookup your-domain.com

Output:

google.com has address 72.14.207.99
google.com has address 64.233.187.99
google.com has address 64.233.167.99
google.com mail is handled by 10 smtp4.google.com.
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 smtp3.google.com.

Leave a Reply

Your email address will not be published. Required fields are marked *