Networking Forums

Networking Forums > Computer Networking > Linux Networking > resolv.conf question

Reply
Thread Tools Display Modes

resolv.conf question

 
 
Geoff Wheeler
Guest
Posts: n/a

 
      02-24-2004, 03:26 PM
I have a home network set up and am in the process of successfully using
a Linux box as a gateway to the wider world. And I have some questions,
starting with these:

I've seen examples of resolv.conf files with domain and search in them,
examples with trailing '.' and without, and examples (and instructions)
to use only search, or only domain. Should I declare my home 'domain'
and search the ISPs, or search both? If searching both, is correct
syntax to use a trailing '.' on the first entry and not on the last? Is
there a limit on the number of nameservers I can list, and should I list
127.0.0.1?

Thanks,
Geoff.
 
Reply With Quote
 
 
 
 
Ian Northeast
Guest
Posts: n/a

 
      02-24-2004, 09:10 PM
On Tue, 24 Feb 2004 11:26:16 -0500, Geoff Wheeler wrote:

> I have a home network set up and am in the process of successfully using a
> Linux box as a gateway to the wider world. And I have some questions,
> starting with these:
>
> I've seen examples of resolv.conf files with domain and search in them,
> examples with trailing '.' and without, and examples (and instructions) to
> use only search, or only domain. Should I declare my home 'domain' and
> search the ISPs, or search both? If searching both, is correct syntax to
> use a trailing '.' on the first entry and not on the last? Is there a
> limit on the number of nameservers I can list, and should I list
> 127.0.0.1?


You will see a lot of incorrect resolv.confs which still work The
resolver is very tolerant.

You should use either domain or search, not both. As the main difference
is that domain can only take one value while search can take many, IMO
search is always preferable. None of the values requires a trailing ".".

Put whatever domains you want the resolver to attempt to add to
unqualified names on the search directive. If you want to resolve names in
your ISP's domain without qualifying them then put them in. I've never
seen the point myself.

You can list up to 3 nameservers. They are used sequentially; the second
is only queried if the first fails to respond at all. It is *not* queried
if the first responds with a "does not exist" (NXDOMAIN). This differs
from the non standard compliant behaviour of the Windows resolver in case
you're used to that.

If you have a local nameserver and it resolves correctly on the Internet
then put 127.0.0.1 (or 0.0.0.0) first. Note that it is expected that all
the nameservers you list return the same answers to all queries (except
for transient effects caused by caching). If they don't strange things may
happen. So if you have a local nameserver which hosts your own private
domain(s), don't list your ISP's nameservers at all, as they won't resolve
them. Instead either configure your local server to forward to the ISP
nameservers or set it up as an independent server with a root cache hints
file, whichever is faster (this mainly depends on how fast your ISP's
servers are; they have a better cache than yours but may be slow). If a
nameserver has a local version of a domain it will refrain from forwarding
queries for it to its forwarders, even if you use "forward only", which
IMO is not intuitive.

You can also do a hybrid of the two with "forward first". This will try
the ISP servers and if they don't answer in a timely fashion do it itself.

Personally I use my own nameservers exclusively and don't touch my ISP's
at all. But this is because their servers are pants (or, in the US, they
suck).

Regards, Ian

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpd.conf, resolv.conf and the search directive Andy Richardson Linux Networking 4 07-13-2005 08:23 AM
Overwriting /etc/resolv.conf Bit Twister Linux Networking 9 04-18-2005 04:18 PM
Question on resolv.conf red Linux Networking 2 02-16-2005 10:58 AM
resolv.conf Stephen Speicher Linux Networking 5 12-10-2003 09:00 AM
NIS, DNS and resolv.conf ncrfgs Linux Networking 2 10-02-2003 05:09 PM



1 2 3 4 5 6 7 8 9 10 11