Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

If I ask Apache for that has no Virtual Host setup in Apache configuration, Apache will show the default Virtual Host. How can I prevent this from happening or simply drop the connection?

share|improve this question
up vote 1 down vote accepted

Use a default virtual host configured to give the response you want in that situation.

Careful what you put there. I've seen clients get upset that we 'stole their domain' when the web host logo came up during some delegation issues =)

share|improve this answer

This is expected behavior - if you have Apache serving on an IP that a domain resolves to but don't have that domain set up as a virtual host, you get the default virtual host. That's just how it works.

share|improve this answer
Thank you but is this OK for a nameserver to open Apache default virtualhost? – Zim3r Dec 14 '12 at 19:44
Listen 80
NameVirtualHost *

<VirtualHost _default_:80>
    RewriteEngine On
    RewriteRule . - [G]

This will send an HTTP 410 "Gone".

You can't prevent it from happening. Apache still needs to listen on that port and it has to do something with that connection.

share|improve this answer
Thanks, It doesn't work. – Zim3r Dec 15 '12 at 19:43
It should. What errors are you seeing? – ablackhat Dec 15 '12 at 20:37
It just normally loads the page. Thanks again. – Zim3r Dec 16 '12 at 8:28

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.