Ubuntu: why does DNS issue occur everytime i restart my ubuntu



Question:

I face DNS issue sometimes in my Ubuntu Server 14.04 version. In order to solve that I follow the procedure mentioned here.

Unable to resolve the DNS:

#ping google.com  ping: unknown host google.com  

But internet connectivity is available:

# ping 8.8.8.8  PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.  64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=15.6 ms  64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=15.7 ms  

So I do repeat the same procedure everytime to resolve the DNS:

# resolvconf -u  # service network-manager restart  network-manager stop/waiting  network-manager start/running, process 9522    # ping google.com  PING google.com (216.58.197.46) 56(84) bytes of data.  64 bytes from maa03s20-in-f14.1e100.net (216.58.197.46): icmp_seq=1 ttl=55 time=23.5 ms  64 bytes from maa03s20-in-f14.1e100.net (216.58.197.46): icmp_seq=2 ttl=55 time=13.2 ms  

So my question is does the procedure suggested is a temporary one as I need to repeat the procedure whenever I face the problem?

What should be done to not to face this again?

EDIT1 : This is how my resolv.conf looks like:

# cat /etc/resolv.conf   # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  nameserver 172.24.100.50  nameserver 10.1.100.50  search <mycompany_name>.com  


Solution:1

The DNS resolution is as dumm as they come: it looks in the /etc/resolv.conf for the nameserver line. In your case it should look like this (after a reboot):

$ cat /etc/resolv.conf  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  nameserver 8.8.8.8  

If the file looks different, the DNS information comming from the DHCP is most likley wrong (http://www.virtualbox.org/manual/ch09.html#nat_host_resolver_proxy, assuming your host also uses the 8.8.8.8 DNS).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »