How to find IP address of DNS Server in Linux
In Category Command Line Networking
The file “/etc/resolv.conf” contains IP addresses of DNS servers along with domain name. A example file is shown below.
[neo@techpulp ~]$ cat /etc/resolv.conf nameserver 202.64.38.98 nameserver 202.64.39.98 [neo@techpulp ~]$
In the above example, Two DNS servers are configured in my system. If you find problems in resolving domain names, just check if the DNS server is reachable or not using “ping” program. If the DNS server is up then you should see ping reply from it as shown below.
[neo@techpulp ~]$ ping 202.64.38.98 PING 202.64.38.98 (202.64.38.98) 56(84) bytes of data. 64 bytes from 202.64.38.98: icmp_seq=1 ttl=64 time=0.993 ms 64 bytes from 202.64.38.98: icmp_seq=2 ttl=64 time=0.812 ms 64 bytes from 202.64.38.98: icmp_seq=3 ttl=64 time=0.817 ms 64 bytes from 202.64.38.98: icmp_seq=4 ttl=64 time=0.872 ms ^C --- 202.64.38.98 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3628ms rtt min/avg/max/mdev = 0.812/0.873/0.993/0.078 ms [neo@techpulp ~]$
Otherwise either DNS server configuration is wrong or there is some network connection problem. Just check if your immediate gateway is reachable or not.
[neo@techpulp ~]$ /sbin/route | grep ^default default 172.16.20.1 0.0.0.0 UG 0 0 0 eth0 [neo@techpulp ~]$ ping 172.16.20.1 PING 172.16.20.1 (172.16.20.1) 56(84) bytes of data. 64 bytes from 172.16.20.1: icmp_seq=1 ttl=64 time=0.893 ms 64 bytes from 172.16.20.1: icmp_seq=2 ttl=64 time=0.812 ms 64 bytes from 172.16.20.1: icmp_seq=3 ttl=64 time=0.817 ms --- 172.16.20.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 3528ms rtt min/avg/max/mdev = 0.812/0.873/0.993/0.078 ms [neo@techpulp ~]$
If there is no response from the immediate gateway, that means there is something wrong with your local connection itself.
Recent Comments