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

Okay so maybe that title is a bit confusing but here is what I'm trying to do:

I have a subdomain with content at my.example.com

I want to set up something like sub.my.example.com

This does not seem to work if there is content on my.example.com However if there is not content on the first subdomain it seems that it's okay to CNAME the record to example2.org

This is my first real experiance with CNAME so I'm wondering about common errors to check for.

my.example.com is an A record and sub.my.example.com is a CNAME

EDIT I am managing the DNS though Web Host Manger (WHM) Dns records. The content is at http://vbx.knowconceptdw.net and I'm trying to set a voicemail CNAME to point to http://api.twillio.com at http://voicemail.vbx.knowconceptdw.net

share|improve this question
    
What type of dns server you use ? What do you mean by content at my.example.com ? Web content ? use dig to find out if that's really an DNS issue or more likely an content server handling issue. –  golja Jul 11 '12 at 2:52
    
Since CNAMEs are supposed to point to somewhere, it might be nice to mention where this mess points to. Also, the actual domain name(s) involved would be handy, so we can check for ourselves for typos, common misconfigurations, and probably identify that it's not a DNS problem after all. –  womble Jul 11 '12 at 2:52

1 Answer 1

CNAME cannot coexist with any other record type. So, if you have a CNAME for a domain, you cannot have A, AAAA, or MX (or anything else) for that domain.

It is compliant to have a subdomain whose only record is a CNAME alongside other subdomains with other record types, as long as there are no other record types for that subdomain. For instance, this DNS data is valid:

example.net IN A 169.254.0.1
example.net IN AAAA fe80::1
example.net IN NS 169.254.0.1
example.net IN MX 10 example.net
a.example.net IN CNAME example.net
b.example.net IN DNAME example.net

If you are using name-based virtual hosting, be aware that you must inform your web server (in apache, this is done with ServerAlias). If you are using SSL, your certificate should be valid for any aliases (wildcard certificates are great for this kind of thing).

If by content you mean when a website is set up on one domain the other doesn't work, this is not a problem with DNS, but with your web server.

To troubleshoot DNS issues on Linux, you can use the dig command, which will produce very informative output. On windows, you can use nslookup. See what it returns for the domain and for the CNAME.

share|improve this answer

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.