rodgerwilco
rodgerwilco

Reputation: 335

how does Apache resolve ip-adresses to host names when using "require"?

I am trying to configure an Apache http server using virtual hosts. Up to now it's working fine. My next step is to restict the access to this vhosts using "Require". There is the option Require host which can be used. So I configured

<RequireAll>
    Require host myCoolHostName
</RequireAll>

But as there is no host name of the requesting client transmitted in the http-header information, I wonder how Apache is determining the host name to check if access can be granted. Can you help me with this question? Is Apache simply querying DNS (or WINS on Windows)?

Thanks

Upvotes: 2

Views: 1334

Answers (1)

Dusan Bajic
Dusan Bajic

Reputation: 10889

This configuration will cause Apache to perform a double reverse DNS lookup on the client IP address, regardless of the setting of the HostnameLookups directive. It will do a reverse DNS lookup on the IP address to find the associated hostname, and then do a forward lookup on the hostname to assure that it matches the original IP address. Only if the forward and reverse DNS are consistent and the hostname matches will access be allowed.

Upvotes: 1

Related Questions