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.

Is it possible to set a CNAME record at the top of a domain? (i.e. @ CNAME www, @ CNAME foobar.com., etc.)

My ISP says that it's only possible to use CNAME's for subdomains but I've read somewhere else that is should be possible even if not recommended.

share|improve this question
    
CNAME is best avoided. You should ask about what you are really trying to do instead. –  janm Sep 30 '10 at 12:00
    
@janm Avoided, why? –  bzlm Sep 30 '10 at 12:10
4  
I want to point a top-level-domain to a amazon cloudfront distribution and they only support cnames. –  Martin Sep 30 '10 at 12:13
    
I should point out that EVERY domain is a "subdomain". example.com is a subdomain of com, and com is a subdomain of .. Any limitations put in place by your ISP are put in place by your ISP and perhaps the registrar, not by the underlying technology. –  ghoti Sep 22 '12 at 16:26
2  
example.com is not a toplevel domain so your question requires a rephrasing. –  bortzmeyer Sep 22 '12 at 21:47
add comment

migrated from stackoverflow.com Sep 22 '12 at 16:56

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 15 down vote accepted

Not possible - this would conflict with the SOA- and NS-records at the domain root.

From RFC1912 section 2.4: "A CNAME record is not allowed to coexist with any other data."

share|improve this answer
3  
The quoted text doesn't say that it's not possible, only that it can't be used with other records. Your NS and SOA records would reside with the canonical name. –  bukzor Aug 28 '12 at 18:11
    
@bukzor By this logic, a CNAME of www.example.com pointing to 1.2.3.4 would be delegating all queries beneath www to 1.2.3.4...because querying www.example.com NS? returns 1.2.3.4. Authority doesn't work that way. It then follows that having no NS records at the top of the zone breaks the entire zone. –  Andrew B Jul 8 '13 at 0:36
add comment

You can setup your domain to be a CNAME to another domain, but then everything will go to that other domain -- including mail and the SOA "start-of-authority" record itself. However, you can still have separate subdomains, like "private.domain.com" use another mail and web server.

share|improve this answer
2  
If the parent zone has NS records and the child "zone" is only a CNAME then some systems will get very confused. –  Alnitak Feb 7 '12 at 16:20
    
This is implementation specific and dangerous advice. Don't CNAME @, ever. –  Andrew B Jul 8 '13 at 0:41
add comment

You can have an @ record set to a CNAME, but all other @ records (including MX) will be ignored and set to the same domain to which it points. However you can point www subdomain to a CNAME, ex.: www CNAME toanotherdomain.com

share|improve this answer
    
This is implementation specific and dangerous advice. Don't CNAME @, ever. –  Andrew B Jul 8 '13 at 0:40
add comment

example.com:

"example" = domain name ".com" = generic domain extension

When you say "example.com is a subdomain of com, and com is a subdomain of " this statement is incorrect.

Sub-domains also called DNS records are what goes before any domain name.

www.example.com mail.example.com webmail.example.com

"www" is a subdomain, so is "mail" so is "webmail"

@ is domain root, it is used when you submit just the domain "example.com" then you will be using the @.

As stated before by other users, you CAN create a CNAME, but it is NOT recommended be because it will cause conflict with your DNS responese.

"Not possible - this would conflict with the SOA- and NS-records at the domain root" I AGREE.

A domain's manager.

share|improve this answer
2  
This is the least coherent answer I've seen here in quite a while, congratulations... –  Dennis Kaarsemaker Nov 14 '13 at 22:49
add comment

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.