Who's rewriting my /etc/nsswitch.conf, eh ?

Submitted by Falken on Wed, 08/06/2008 - 20:29

First my OpenSuSE machine at work decides to have it, and now I discover the reason why my Kubuntu laptop has been having horrible intermittent DNS resolution problems.
The offending entry in both cases was on the 'hosts:' line and said something like 'mdns4_minimal [NOTFOUND=return]' part away along.
At work, this utterly screwed up any attempt to resolve '.local' DNS names, which just happens to be the recommended way MicroSoft Active Directory is used, so it had to go there.
At home, this caused resolution of internet host names to occasionally fail. When a particular host did fail, it would remain unresolvable for several minutes, then suddenly it would be OK.

This 'mdns' section makes attempts to resolve host names (using ping, firefox etc, but not nslookup) behave very very badly (either stop working or work sometimes, apparently). It's meant to let IPv6 hosts find their own DNS servers in leu of DHCPv6. In practice it just makes programs look in the wrong place, thus breaking stuff (my machine at work was asking hosts on the internet from it's private IP network).
In both cases, the fix is to strip out the 'mdns...' section that has appeared (but leave the rest of the line alone). Apparently it's something to do IPv6 dynamic address lookups or something, but near as I can tell it just breaks stuff.
You may also need to add or modify a line in /etc/host.conf so it reads 'mdns off' as per Novell's tip.

I can understand why people might want to ship machines with all the IPv6 auto-conf. goodness on by default, but if the practical upshot is that everyone has to turn it all off to get a working system, what's the point ?