• Increase font size
  • Default font size
  • Decrease font size

how to set dns in linux

 Login as the root, enter:

# vi /etc/resolv.conf
 
OR
$ sudo vi /etc/resolv.conf
Modify or enter nameserver as follows:
nameserver 202.103.227.68
nameserver 202.103.225.68
 
Save and close the file. To test DNS configuration type any one of the following command:
# host google.com
# ping www.bing.com
# nslookup www.bing.com
 
Output:
 
[root@localhost ~]# host google.com
google.com has address 74.125.127.100
google.com has address 74.125.45.100
google.com has address 74.125.67.100
 
[root@localhost ~]# ping www.bing.com
PING a134.g.akamai.net (61.213.189.115) 56(84) bytes of data.
64 bytes from 61.213.189.115: icmp_seq=0 ttl=50 time=107 ms
64 bytes from 61.213.189.115: icmp_seq=1 ttl=50 time=109 ms
64 bytes from 61.213.189.115: icmp_seq=2 ttl=50 time=60.3 ms
64 bytes from 61.213.189.115: icmp_seq=3 ttl=50 time=96.8 ms
 --- a134.g.akamai.net ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 60.380/93.384/109.166/19.620 ms, pipe 2
 
[root@localhost ~]# nslookup www.bing.com
Server:         202.103.225.68
Address:        202.103.225.68
 Non-authoritative answer:
www.bing.com    canonical name = search.ms.com.edgesuite.net.
search.ms.com.edgesuite.net     canonical name = a134.g.akamai.net.
Name:   a134.g.akamai.net
Address: 61.213.189.115
Name:   a134.g.akamai.net
Address: 61.213.189.113
Tags:
 

Add comment


Security code
Refresh