[Pkg-utopia-maintainers] Bug#892854: Hostname resolution getting stuck for many seconds
Simon McVittie
smcv at debian.org
Tue Mar 13 23:36:11 UTC 2018
On Tue, 13 Mar 2018 at 20:52:28 +0100, Eduard Bloch wrote:
> I checked the process with strace and saw something weird. My DNS was
> accessed, was queried, it returned data, then the connection was closed
> and then it started doing something with your library and THAT is where
> it didn't continue anymore.
What's in the hosts: line in your /etc/nsswitch.conf?
New installations of nss-mdns will set it up with
mdns4_minimal [NOTFOUND=return]
just before either resolve or dns, whichever is seen first. That means
only names in the .local domain are resolved this way. For example, on
a machine with systemd-resolved and various other non-standard modules,
I have:
hosts: files mymachines gw_name myhostname mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
However, we don't edit nsswitch.conf if there is already a mention
of mdns (because that way there'd be a risk of overwriting sysadmin
configuration or otherwise breaking stuff), so in particular old
installations that already had nss-mdns installed before 2013 can have
a no-longer-recommended configuration left over.
>From your strace showing libnss_mdns4.so.2 being loaded, I think you
have mdns4 instead of mdns4_minimal. mdns{,4,6} tries to look up more
names in mDNS, and because of how mDNS works, will cause an arbitrary
delay for each name that cannot be resolved by any means (hosts file,
DNS, mDNS, whatever). I don't think there's much we can do about that
without making it impossible to choose the "non-minimal" behaviour.
If you purge and reinstall libnss-mdns, it should come back with a
better configuration that doesn't cause arbitrary delays (unless you
specifically ask to resolve a .local name that doesn't exist).
smcv
More information about the Pkg-utopia-maintainers
mailing list