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

I'm having a strange problem. I'll be quick about the setup:


Following are A-records pointing to the same IP:


I have tried using CNAME for the sub-domains, but that did not change anything.

Apache 2 setup

I have two virtual-hosts:

<VirtualHost *:80>
  DocumentRoot /var/www/a
  [...log setup]


<VirtualHost *:80>
  DocumentRoot /var/www/b
  [...log setup]

Take notice that there is no host set up for


Now to the problem. When I enter it says server not found instantly. Have tried clearing cache and all that, and on several computers. and serve from the right directory. redirects to for some reason.

The config above is the only one under sites-enabled, but it also loads a config from phpmyadmin.

I guess what I'm asking is, how do I begin diagnosing the problem? How can I rule a DNS problem out? I have tried adding as a serveralias to the current config - nothing changes. And I have no idea why redirects - there's not wildcard anywhere as far as I can see.

Where do I start?

share|improve this question
You have hosts in zone, not subdomains!!! Shit, when i'll be happy to see again correct usage of terms by hostmasters?! –  Lazy Badger Nov 3 '11 at 4:24

2 Answers 2

When someone queries a non-existent domain name, the reply that it does not exists (NXDOMAIN), cached in the intermediate DNS servers.

Possibly for, negative reply was cached somewhere.

To test, try

1. nslookup (or dig
2. nslookup (or dig

If that is the case, you'll get negative answer in 1. and your IP in 2.

There's no solution other to wait the time specified in the last field of your SOA record (nslookup -type=SOA or dig SOA). To prevent it in the future, put there some lower value.

As for - it falls back to the first VirtualHost defined. It is normal behavior.

(I'd agree that if you would post the real domain name, it would make our life better)

share|improve this answer

I guess what I'm asking is, how do I begin diagnosing the problem? How can I rule a DNS problem out?

  1. In case of multiply virthosts in Apache, fist virthost serves as fallback for all hosts-requests, which aren't found in visthosts lists, but reach server due to DNS configuration (or other methods), it's clearly OK for your non-existing virthost
  2. Never, never mask domain in case of domain-related issues - this way you guaranteed to compel all interested in the answer to guess, instead of testing and debugging.
  3. For me "" is perfectly valid according to you quote, but I prefer to test it real life
  4. Wild guessing - can somehow resolve to wrong IP, without http-server on it. How to test
    • nslookup, verify
    • traceroute OR traceroute
    • telnet 80 and perform shortest http-session, if connected or use wget for monitoring actons of http-client with site dev
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.