"host" and "dig" hang when nameserver 127.0.0.1 is given in /etc/resolv.conf
Given the following /etc/resolv.conf:
nameserver <a non-responding IP address, eg 127.0.0.1>
nameserver <a responding IP address, eg 192.168.122.1>
then given a non-resolvable IP address, the "host" command (based on dighost.c) hangs as does the "nslookup" command.
The "dig" command terminates.
Given a non-existing hostname (eg "grimbleprizzies"), the commands terminate. (this is on a VM with dnsmasq running on the host, so the server running on 192.168.122.1 responds)
- When giving "host" the "-s" option, the command terminates.
- When only "nameserver 127.0.0.1" is specified, the commands terminate.
- When the two entries are swapped, the commands terminate.
This was observed on 9.14.8 but also on an older 9.11.2.
When on 9.11.2, "127.0.0.1" is replaced with "localhost", the commands terminate.