httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <...@bourse.ch>
Subject Re: Can I avoid DNS lookup for servername?
Date Mon, 18 Feb 2002 14:38:20 GMT
Santosh Deshpande wrote:
> 
> what happens if the the line
> hosts:      files dns
> is commented out? Does it not look in the /etc/hosts first anyway?

Probably. According to my man page for nsswitch.conf:

"The library functions contain  compiled-in  default  entries that  are 
used if the appropriate entry in nsswitch.conf is absent or
syntactically incorrect."

The underlying function in this case is gethostbyname() - I suppose its
default value is system dependent, but /etc/hosts would be a good
default (works on any system - even without a network).

However, since there's a mechansim for setting the order, why not use
it?  if you say:

hosts: files

then you can be sure gethostbyname() will *only* look in /etc/hosts and
*will not* use DNS for name resolution.

Rgds,

Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message