I'm trying to grant access to a site to our company only.

When I'm using Require host, I'm receiving 403 errors:

Require host gateway.ourcompany.com

However, if I use our IP address explicitly, I'll get the site:

Require ip

Why is that? Do I have to enable some DNS related module for host to work?


Make sure your reverse lookup also works well because apache checks both direct and reverse lookup:


Hosts whose names match, or end in, this string are allowed access. Only complete components are matched, so the above example will match foo.example.org but it will not match fooexample.org. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.