Cannot resolve host through FQDN, yet resolving its simple name works
When you plugin a default ubuntu installation into a network which uses a .local TLD then you can run into a problem.
out-of-the-box the Name Service Switch service has a configuration file which conflicts with this situation.
When you ping a server like for instance myserver.example.local it will not work.
When you ping myserver then you do get replies.
This behaviour is cause by the following line in your /etc/nsswitch.conf file:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
nsswitch uses this configuration file to determine how it should lookup information regarding (in this case) hosts.
It will first check the filesystem (/etc/hosts for intance) to do a name resolve. Then it will do a minimal multicast DNS and if still no result is returned then a NOTFOUND will be returned.
Whenever you network is setup in a zeroconf environment (no DNS server present) then the multicast will not happen for .local domains.
To fix this situation you need to move on of the databasenames from the hosts line to the send in line. See the following fixed hosts line in /etc/nsswitch.conf:
hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4
Save the file and try to do a ping again. You will now see that it works (if ICMP protocol is not blocked by firewalls ofcourse

Comments are closed.