Pointless DNS lookups

[email protected] (Rob Ristroph) 16 Feb 2004 00:32:27 -0600
Newsgroups gmane.linux.usability.annoyances
Message-ID <[email protected]>
I have found that emacs and mc, among other programs, will make a DNS
lookup or reverse lookup when you do not expect them to.  They don't
time out very quickly if there is no response.  For example, on some
computers disconnecting the network essentially makes it impossible to
launch emacs.

MidnightCommander will also do a reverse DNS lookup of the IP address
if you attempt to use it to ftp to a numeric address.  On a network
with no resolver and only IP addresses, this can also cause a
mysterious hang.

One way to confirm that this is the cause of a program hanging is to
run it with strace and look in the log for the loading of
/lib/libnss.so.  In MC's case, the mc executable itself is not linked
against libnss, so ldd will not reveal the dependency (libnss is
loaded only when needed).

Working around this can be as simple as putting the libnss on your
floppy distribution and also setting uo an appropriate /etc/hosts, or
running a local caching bind.

I'm not sure where in the L.A. this tidbit might fit in, but maybe
somewhere you can mention that unexpected hangs can be due to network
activity waiting to time out even if the program doesn't seem to need
to use the network.

--Rob