According to the man page, host
ought to query "the server or servers listed in /etc/resolv.conf
," but it only uses the first entry in that file:
thefourthtower:$cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 192.168.1.254
domain gateway.2wire.net
search gateway.2wire.net
thefourthtower:$host thefourthtower
Host thefourthtower not found: 3(NXDOMAIN)
thefourthtower:$host thefourthtower 192.186.1.254
thefourthtower.gateway.2wire.net has address 192.168.1.74
The 2wire
bit comes from a 2Wire modem/router. AT&T (or 2Wire?) have equipped the thing with very poor firmware and its DNS server (cache) is generally slower than Google Public DNS, a problem compounded by AT&T's own flaky DNS servers (no option for alternate servers).
Can I get host
or nslookup
to use further /etc/resolv.conf
entries (and avoid specifying servers manually)?
Or is the only solution to manually map hosts in /etc/hosts
, given the desired ordering of the resolv.conf
entries?
UPDATE
Nothing in the above implies that I think Google's nameserver should know about my local hosts.
I am asking: can one use a certain nameserver for local names only (since a name like 'thefourthtower' must be local)?
It looks like the answer is NO, and I must run a nameserver on my machine, because the extant local nameserver is so poor.