[Gllug] Resolving question

Tethys tet at createservices.com
Tue Nov 30 15:28:56 UTC 2004


Jack Bertram writes:

>Do _all_ (normal) programs use the resolving order defined in
>resolv.conf?  I anticipate some DNS difficulties over the next few days
>and want to know whether I can add /etc/hosts entries to overcome these
>for one particular server.

Yes and no. They use the gethostbyname() function, which first checks
/etc/nsswitch.conf to see the order in which to try hostname lookups.
Usually, this will be "files dns". Some people will have NIS in there,
too, but unless you *really* need that (and I can't think of any cases
where that would be true), remove it.

Thus it will first check local files (in this case, /etc/hosts). If it's
not found there, it will then move on to DNS, and use the contents of
/etc/resolv.conf

You don't need to make any changes to the application.

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list