In article <(E-Mail Removed) .com>,
AnthonyM wrote:
Not meant as a slam - you are doing good.
>In my limited experience, I have noticed that dig doesn't use the
>/etc/resolv.conf and /etc/host.conf files, but ping does.
Close. 'dig' (and 'dnsquery' and 'host' and the deprecated 'nslookup'
are DNS tools, and as such ONLY query the localhost name server or
the name servers listed in the /etc/resolv.conf file by default. 'dig'
does not look at the 'domain' or 'search' entries (dnsquery, host,
and nslookup do).
You are correct about dig (and the other DNS query tools) ignoring
the /etc/host.conf file. They also ignore /etc/nsswitch.conf.
>Check resolv.conf and make sure you have these entries:
>--------------
>domain servenet.local
>nameserver 127.0.0.1
>---------------
Do read the man page for 'resolver' and see exactly what the 'domain'
keyword does. There is also a 'search' directive that may be useful,
but because the two directives are not compatible, the last one
found in the /etc/resolv.conf file OVERRIDES the other.
Also, 127.0.0.1 (or _any_ address) should only be listed as a name server
if it is able to answer ALL queries. The resolver believes the first
answer it receives, even if that answer is "I don't know".
By default the resolver (and DNS query tools) look FIRST for a name
server running on localhost even if localhost (or 127.0.0.1) is not
listed in /etc/resolv.conf. The 'nameserver' directive is used to
override asking localhost - meaning use this address INSTEAD OF
localhost.
Lastly, by default, /etc/resolv.conf can only contain up to $MAXNS
(see </usr/include/resolv.h> where MAXNS is normally set to 3)
nameserver directives.
>Check host.conf and make sure you have these entries:
>-----------------
>order hosts bind
>multi on
>------------------
/etc/host.conf is for the libc5 libraries. Virtually all Linux now
use glibc2 (formally known as libc6) and that uses /etc/nsswitch.conf
for this. You need to have a line referring to hosts, that at least
has
hosts: files dns
which says to check the local hosts file first, then check DNS if the
answer isn't in the hosts file. Your distribution probably includes
'nis' and/or 'nisplus' keys which refer to NIS (Yellowpages) services
not normally used at home. It's explained in the 'nsswitch.conf' man page.
>Check the man pages on these files if you have any questions on the
>syntax or what it means.
True.
>Hope this helps
Nicely done.
Old guy
|