Can not resolve .local domains internal to my office LAN

host and nslookup perform DNS lookups, however most applications use glibc's Name Service Switch to decide how host names are looked up.

Your /etc/nsswitch.conf might enable mDNS, which might cause the issues when resolving .local names. You could change the order in which lookups are made or just remove mDNS service if you think you won't need it.

Your nsswitch.conf's has mdns4_minimal, which does mDNS lookup (for .local names). The [NOTFOUND=return] after it causes the lookup to stop and therefore DNS is never used and your application can't resolve the host name. You could either remove the whole mdns4_minimal [NOTFOUND=return], so mDNS lookups are not used, or just remove the NOTFOUND action so DNS lookup would be made should mDNS lookup fail.

For further details, I recommend checking out the Name Service Switch documentation .


The bigger problem here is: it is known DNS domain names ending in .local should not be used when setting up DNS infra-structures.

.local use is reserved for zeroconf/avahi aka bonjour usage, which are parallel services for resolving local names/services besides DNS.

Your internal DNS name service is most certainly having conflicts with zeroconf in some scenarios. Thus the solution in the question you accepted.

In the longer term, your internal network DNS name should not end in .local.

PS As an aside, besides DNS, local Microsoft DCs/ADs should not be named .local too. You will have strange problems going on if you do that.

Multicast DNS (mDNS) standard.
The Internet Engineering Task Force (IETF) standards-track RFC 6762 (February 20, 2013) reserves the use of the domain name label local as a pseudo-top-level domain for hostnames in local area networks that can be resolved via the Multicast DNS name resolution protocol.

From MS Technet (wikipedia)

If you have Macintosh client computers that are running the Macintosh OS X version 10.3 operating system or later, … it is recommended that you do not use the .local label for the full DNS name of your internal domain. If you must use the .local label, then you must also configure settings on the Macintosh computers so they can discover other computers on the network

RFC 6762

Any DNS query for a name ending with ".local." MUST be sent to the
mDNS IPv4 link-local multicast address 224.0.0.251 (or its IPv6
equivalent FF02::FB).

......

  1. Reverse Address Mapping

    Like ".local.", the IPv4 and IPv6 reverse mapping domains are also defined to be link-local:

    Any DNS query for a name ending with "254.169.in-addr.arpa." MUST be sent to the mDNS IPv4 link-local multicast address 224.0.0.251 or the mDNS IPv6 multicast address FF02::FB. Since names under this domain correspond to IPv4 link-local addresses, it is logical that the local link is the best place to find information pertaining to those names.

......

No special control is needed for enabling and disabling Multicast DNS for names explicitly ending with ".local." as entered by the user.
The user doesn't need a way to disable Multicast DNS for names ending with ".local.", because if the user doesn't want to use Multicast DNS, they can achieve this by simply not using those names.
If a user does enter a name ending in ".local.", then we can safely assume the user's intention was probably that it should work.

While not from an official source, I also found this, which has a paragraph that explains the issue nicely: Stop using .local as the top level domain for your LAN

The .local domain is what is called a pseudo-top-level domain. What does that mean? It means that it’s not an official top level domain usable (routable) on the internet, but it has a semi-official standing because it is used in some applications.
In the case of .local it is used by the Multicast Domain Name Service (mDNS). Hosts that implement this service use .local as their domain names and have their own way of resolving names. Normally, this wouldn’t be a problem; however, if you also implement DNS on your network with .local as the top-level domain it will cause serious name resolution issues.
I’ve seen this happen a lot on Linux systems, and I imagine Apple’s OS X will probably have these issues as well. Usually, on these types of networks you find that DNS name resolution doesn’t work at all or works only some of the time. In the end, you end up having to use ip addresses all the time because you don’t know whether a name might resolve or not (which negates the whole point of having a DNS server in the first place).

Tags:

Dns

Debian

Mdns