ksaitoの日記

日々試したことの覚え書き

libnss-mdnsパッケージをインストールするとdnsが引けなくなる

移転しました。

自動的にリダイレクトします。

なぜかdigコマンドでアドレスの正引き、逆引きができるのに、ホスト名でアクセスしようとすると、そんなホスト知らんと言われる現象が発生しました。
原因は、libnss-mdnsパッケージが/etc/nsswitch.confを書き換えhostsがdnsを参照しないように設定されたためでした。
下記に情報がかかれています。

$ cat /usr/share/doc/libnss-mdns/README.Debian 
Packages automagically modifies /etc/nsswitch.conf
--------------------------------------------------

Previously the base-files package shipped /etc/nsswitch.conf and specified:

    hosts:          files dns mdns

However, due to bug#351990, this is no longer the case. /etc/nsswitch.conf
is now generated post-installation. Upon installation of nss-mdns, if the
strings 'mdns', 'mdns_minimal', 'mdns4', 'mdns4_minimal', 'mdns6' or
'mdns6_minimal' appear on the hosts line, your /etc/nsswitch.conf file
will not be updated, otherwise it will updated to match the upstream
recommended configuration which usually looks like:

    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4


Sites with a .local DNS zone
----------------------------

Making nss-mdns authoritative for .local breaks resolution on networks
where .local is a real domain name.  To workaround this, avahi-daemon
should be restarted when the DNS settings change (for example via
resolvconf and dhclient hooks) and disable itself when a SOA for the
.local zone is found.  This is not currently implemented at the time of
writing, but should soon be.

See also this excellent summary on the upstream website:
    <http://avahi.org/wiki/AvahiAndUnicastDotLocal>

$

mDNSを意識してインストールした覚えはないのですが、おそらくsun-java6-jreをインストールしたときに、友連れでインストールされたようです。
/etc/nsswitch.confを書き換えるかlibnss-mdnsをアンインストールすることでDNSを参照できるようになります。

$ sudo aptitude purge libnss-mdns


こちらの原因も同じ理由かもしれません。