Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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>
    ServerName thirdlevel.servername.foo
    DocumenRoot /path/to/document/root
    # some other apache config
</VirtualHost>

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
name: servername.com.
value: 12.34.56.789 (real IP here, of course)

record type: A
name: www
value: 12.34.56.789

record type: CNAME
name: thirdlevel.servername.foo.
value: servername.foo

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 thirdlevel.servername.foo thnks

Alessandro

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

3 Answers 3

up vote 3 down vote accepted
  1. You appear to have servername.com and servername.foo 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 thirdlevel.servername.foo. 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 servername.foo.).

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:

$ORIGIN servername.foo.
$TTL 14400
@       86400   IN      SOA     YOUR.NS1.GOES.HERE.      your.email.with.at.replaced.by.dot.comcast.net.   (
                                        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       123.45.67.89
www             14400   IN      A       123.45.67.89
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:   *.yourdomain.com
type:    CNAME
target:  yourdomain.com
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

 
discard

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.