Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems that the if I go to my apache httpd-server with only the ip-address it will always default to the first vhost-config domain which is alphabetically first configured in the sites-enabled folder.

Now I have the case that some strange domain has as a DNS-resolution to our server which is obvisously wrong but results in error entries in my error.log file. If I enter this domain name in my browser I end up on one of my sites, actually the first on configured in the sites-enabled folder as vhost-config. This is the same behaviour as if I enter the ip-address of the server in my browser.

To solve this problem I entered a new virtual-host config file with the name aaa-catherror.conf which handles this cases as described in

But I wonder if this is the best solution.

share|improve this question
up vote 1 down vote accepted

If some unknown party points their hostname at your server's IP, the best you can do is create a dummy vhost and deny access to everything and everybody in it.

It would be even better if you made THAT vhost the first one, so that every hostanme that is not explicitly configured is denied.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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