====== Ubuntu - Networking - DNS - Switch configuration file ====== The **/etc/nsswitch.conf** is an important files regarding dns configuration. This file determines the order of the name resolution. By default, the host file is checked first, then the configured DNS. There could be more options. Take a look at the file: ... hosts: files dns ... The **hosts:** line specifies the order in which various name resolution services will be tried. This example is to: 1. Begin by checking the /etc/hosts file. If that file provides an IP address for the host name in question, it is used. 2. Then try the specified DNS servers. It will check the dns servers in order. This config then means that **/etc/hosts** entries can override information in the dns configuration file, as they will be acted on first. Legal entries are: * compat Use compatibility setup * nisplus Use NIS+ (NIS version 3) * nis Use NIS (NIS version 2), also called YP * dns Use DNS (Domain Name Service) * files Use the local files * [NOTFOUND=return] Stop searching if not found so far ---- ===== Another example ===== ... hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 ... The hosts: line specifies the order in which various name resolution services will be tried. The default is to: 1. Begin by checking the /etc/hosts file. If that file provides an IP address for the host name in question, it is used. 2. Otherwise try mdns4_minimal, which will attempt to resolve the name via multicast DNS only if it ends with .local. If it does but no such mDNS host is located, mdns4_minimal will return NOTFOUND. The default name service switch response to NOTFOUND would be to try the next listed service, but the [NOTFOUND=return] entry overrides that and stops the search with the name unresolved. 3. Then try the specified DNS servers. This will happen more-or-less immediately if the name does not end in .local, or not at all if it does. If you remove the [NOTFOUND=return] entry, nsswitch would try to locate unresolved .local hosts via unicast DNS. This would generally be a bad thing , as it would send many such requests to Internet DNS servers that would never resolve them. Apparently, that happens a lot. 4. The final mdns4 entry indicates mDNS will be tried for names that don't end in .local if your specified DNS servers aren't able to resolve them. This is thought to catch mDNS hosts when there is not .local TLD specified. ---- ===== References ===== Further information on nss-mdns can be found at http://0pointer.de/lennart/projects/nss-mdns/