Sunday, 2 July 2017

Ubuntu DNS host resolution issue fixed

Unknown host? what why?

The other day I moved from static IP's to DHCP in my VirtualBox lab and once I did that I found an issue that perhaps others are facing.

When the dynamically assigned DNS was able to resolve external domains such as google etc, I was not able to resolve local ones.

The cause of this issue is the /etc/nsswitch.conf and the line hosts.  If you look closely you can see that the dns is after the not found return, now you might be asking how is this working for google then if dns is not used, well that would be the power of mdns and since my dns wasn't supporting mdns it failed.

Original
hosts:          files mdns4_minimal [NOTFOUND=return] dns

Fixed
hosts:          files dns mdns4_minimal [NOTFOUND=return]




So I moved the dns to the second entry of the line leaving everything else the same and poof like magic problem solved.

No comments: