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

Hi everyone I'm a web developer and I've started admininstrating a small VPS for hosting some very small websites. For testing pourpose we need to create a third level domain, but I'm not shure about how to configure it. The server is running Debian stable with apache2. I've added a virtual host for third level domain:

<VirtualHost *:80>
    DocumenRoot /path/to/document/root
    # some other apache config

Now, in the control panel of my ISP (where I bought the domain) I've put those parameter for DNS configuration, and I have no idea if this is correct or not:

record type: A
value: (real IP here, of course)

record type: A
name: www

record type: CNAME

after some hours the last rule (which is the one i'm not sure about) was marked "active" but I still cannot access my website pointing thnks


share|improve this question
It is very difficult to debug a DNS problem when you hide the real names. We cannot even test, so all the answers you will get are only guesses. – bortzmeyer Oct 11 '10 at 9:20
sry, I've found out that the problem was caused by a conflict in the zone config. now, It should work. – ArtoAle Oct 12 '10 at 9:12
up vote 3 down vote accepted
  1. You appear to have and in the same zone. There should only be one domain per zone.
  2. If you just forgot to change the first .com to .foo, then should just be thirdlevel
  3. For the value of thirdlevel, you need a . on the end, or it will append the origin for you (assuming the zone file starts with $ORIGIN

If you have access to the text of the zone file, instead of the usual annoying HTML form that most registrars provide, you want something like the following:

$TTL 14400
@       86400   IN      SOA     YOUR.NS1.GOES.HERE.   (
                                        201009091812 ;Serial Number
                                        86400 ;refresh
                                        7200 ;retry
                                        3600000 ;expire
                                        86400 ;minimum
                86400   IN      NS      YOUR.NS1.GOES.HERE.
                86400   IN      NS      YOUR.NS2.GOES.HERE.
                14400   IN      A
www             14400   IN      A
thirdlevel      14400   IN      CNAME   @

The @ gets replaced by whatever $ORIGIN is set to, so you don't have to keep retyping it. I am curious why you can't just use another A record for thirdlevel.

share|improve this answer
I'm completely noob about DNS managing, so I tought a good point was to use CNAME. Now I know I must use A record for third level. I only have access to HTML form, so I must use it. The .org/.foo problem is not the point (in fact it's just a fake server name, not the actual one :D) – ArtoAle Oct 9 '10 at 21:49

It might take sometime for DNS changes to replicate everywhere.
Check if you can resolve the new CNAME already.
The apache configuration looks good so far.

share|improve this answer

Your Apache2 is configured correctly, but in your domain's DNS you are missing CNAME record for any third level domain

value:   *
type:    CNAME
share|improve this answer
The accepted answer is substantially better and doesn't imply that you must add wildcard CNAMEs and also points out that CNAMES aren't even necessary. – Theuni Dec 8 '12 at 23:26

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.