[Pkg-utopia-maintainers] Bug#892854: Hostname resolution getting stuck for many seconds

Eduard Bloch edi at gmx.de
Wed Mar 14 19:01:07 UTC 2018


Hallo,
* Simon McVittie [Tue, Mar 13 2018, 11:36:11PM]:
> 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?

hosts:          files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4

> 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.

ETOOMUCHINFORMATION

I cannot remember having touched this file ever on this system. And I
guess that if you have a record of all versions installed in the past
then it should be easy to detect a pristine copy of that file and
update/replace it as needed.

$ md5sum /etc/nsswitch.conf 
60686f928ec8782f409b742e49314427  /etc/nsswitch.conf

> 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).

Ok, I did just that (had to purge another multiarch version as well) and
now it works, just as you described.

Still, I think this problem deserves a better solution. Because it's not
really obvious for the user what is going on in case of such trouble.

Best regards,
Eduard.



More information about the Pkg-utopia-maintainers mailing list