How to change or setup DNS server IP address on Linux
Domain name service is accountable for associating domain names with IP address, for example domain yahoo.com is easy to remember than IP address 192.168.1.100. In my Previous article Free fast public DNS servers list for your network, I have mentioned free public DNS being offered by some quality providers. Here I am going to write down the method how you can setup DNS server IPs on Linux machine.
In Linux, local name resolution is done via /etc/hosts file. In case of a small network, use /etc/hosts file. To configure Linux as DNS client you need to edit or modify /etc/resolv.conf file. This file contains information that allows a computer connected to the Internet to convert alpha-numeric names into the numeric IP addresses that are required for access to network resource over the Internet. This file contains DNS server IP addresses that attempt to resolve names into addresses for any node available on the network.
SETTING UP DNS SERVER IP
Steps to configure Linux as DNS client, first login as a root user (use su command):
Step # 1: Open /etc/resolv.conf file:
# vi /etc/resolv.conf
Step #2: Add your ISP nameserver as follows:
search isp.com nameserver 220.127.116.11 nameserver 18.104.22.168 nameserver 22.214.171.124
Note Max. three nameserver can be used/defined at a time.
Step # 3:Test setup nslookup or dig command:
$ dig www.google.com $ nslookup www.google.com
In my next post i will let you know How to change or setup DNS server IP address on Microsoft Windows Vista / XP / Server 2003.