[Wylug-help] Dual NIC, hosts, resolv and all that

Jim Jackson jj at franjam.org.uk
Sat Feb 4 15:32:55 GMT 2006




On Fri, 3 Feb 2006, Stephen Patterson wrote:

> On 03 Feb 06, Dave Whiteley (d.l.whiteley at ee.leeds.ac.uk) wrote:
> > I thought that the "host" command would use the configured lookup method
> > - OK, so I am wrong.
>
> host & dig both just consule your dns servers, other commands tend to look at
> /etc/hosts first.
>

Not quite the full picture.

The "standard" (well most current) gethostbyname routines etc interrogate
the file

 /etc/nsswitch.conf

for details of what databases to look at, and in what order, for doing
name to IP address and vice versa. This file has a line

 hosts:          files dns

which defines how to do host names, the above line means look things up in
/etc/hosts first and if it fails do a DNS look up. Other options include
NIS. You can disable DNS lookups by changing this line to just...

 hosts:    files

which can often be useful.

People often forget this file. Double check the settings.

Jim



More information about the Wylug-help mailing list