httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Ruggeri <smallh...@crawblog.com>
Subject Re: [users@httpd] Using VirtualHosts, do I need to specify "main" ServerName?
Date Sun, 27 Sep 2009 15:41:07 GMT
On Sat, Sep 26, 2009 at 6:21 PM, Norman Peelman <npeelman@cfl.rr.com> wrote:
> Apache (linux/windows) will check the 'hosts' file first and then do DNS
> lookups when no matches are found. I don't understand why your not worried
> about why it needs it but you are worried about how it gets it. The main
> server needs a name just like the vhosts, for the very reasons you yourself
> gave.

Excuse me: DNS associates IP's to names.  I understand that apache
wants a host name.  But it won't find it through DNS.

When I say I'm not worried about Apache finding a host name, it's
because I know how to configure hostname and /etc/hosts (or just
specify ServerName) so that Apache gets the correct hostname.  I can
easily make the error go away.  What I'm worried about is the
documentation claim that Apache needs to do a DNS lookup to find an IP
address.  I don't understand what this IP could possibly be used for
(though the documentation seems to think that's obvious?).

So, let me restate my two questions:
(1) Does Apache really ever try to do a lookup (either in /etc/hosts
or DNS) for an IP address, as seems to be implied by the
documentation?
(2) Why would it?  That is, what would the IP address be used for.

I also reference the documentation again, below:

"The addition of name-based virtual host support in Apache 1.1
requires Apache to know the IP address(es) of the host that httpd is
running on. To get this address it uses either the global ServerName
(if present) or calls the C function gethostname (which should return
the same as typing "hostname" at the command prompt). Then it performs
a DNS lookup on this address. At present there is no way to avoid this
lookup."


-- Ned Ruggeri

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message