Can't set "example.com" as a CNAME record?

65,599

Solution 1

You cannot set a CNAME record for a root domain (e.g., example.com) because that would break RFC 1034 section 3.6.2, which states,

If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different.

You can’t do this for example.com because example.com will also have NS records to make it work which breaks the rule that no other data should be present.

You can have a CNAME record for www.example.com because this is not the root domain, and therefore it is easy to have no other data present for it.

The only ways to get around this are to either

  • use the www prefix, or
  • to get your domain parked where you want the CNAME record to point, and get the relevant IP address to set up an A record for example.com.

I just read that you’re using dynamic DNS. Some dynamic DNS providers can work with your domain if you host it on their nameservers: this way their dynamic DNS updaters can update example.com’s IP address, and you avoid any CNAME issues altogether. Off the top of my head I only know of dyndns offering this as a paid service.

Solution 2

You can not set naked domain name in CNAME records. You must have to do ONLY those settings for alias domains like www.example.com , about.example.com and more at CNAME records and the primary or ROOT domain settings must be done at A Records and you have to provide IP address of host. First delete the settings from CNAME about the naked domain and set it at "A Records" and then do settings at C Name for alias like www, about or anything like that.

This may help you: A Records, CNAME, MX Records : Basics to Setup Your Blog

Solution 3

I found that CNAME of a naked domain via @ Record like mentioned here doesn't work for some domain providers. To get out from this you can consider to point your NAME SERVERS to a DNS provider who support the ALIAS or ANAME.

Follow to this there are some DNS hosts provide a way to get CNAME-like functionality at the zone apex (the root domain level, for the naked domain name) using a custom record type.

Such records include, for example:

  • ALIAS at DNSimple
  • ANAME at DNS Made Easy
  • ANAME at easyDNS
  • CNAME at CloudFlare
  • ALIAS at CloudDNS

For each provider, the setup is similar: point the ALIAS or ANAME entry for your apex domain to example.yourdomain.com, just as you would with a CNAME record.

ALIAS or ANAME or @ example.whateverdomain.com.
Share:
65,599

Related videos on Youtube

teuneboon
Author by

teuneboon

Experienced developer(for my age at least), interested in Java, PHP and javascript and always looking into new techniques.

Updated on September 18, 2022

Comments

  • teuneboon
    teuneboon over 1 year

    I'm currently running a server at home, but I have a dynamic IP. So I subscribed to a dynamic dns service(dlinkddns.com). I made all the correct settings in my own network, and the ip updates perfectly.

    The problem is that I have a domainname(let's say: "example.com"), and I want to set the root domainname without any prefixes ("example.com") to CNAME to my dlinkddns domain. But my domain name DNS host says I can't do that(it's "not allowed"). I can do it for "www.example.com" etc. and that works perfectly, but just not for the root domain name. Anyone knows a solution to this?

    • Jonathan Ross
      Jonathan Ross about 13 years
      Which DNS host are you using ? It sounds like their software wants an A Record to have a prefix to the Domain like www.domain.com for a reason.
    • Jonathan Ross
      Jonathan Ross about 13 years
      I'd ask them for help or check documentation.
  • Mason G. Zhwiti
    Mason G. Zhwiti about 10 years
    For what it's worth, Hover.com does allow you to use a CNAME on a naked domain (aka apex of the domain). No warning is given when doing this through their interface. I've no idea of the practical effects, but it's working for me so far.
  • anthonysomerset
    anthonysomerset about 10 years
    MasonG.Zhwiti Just because you can, doesn't mean you should... it still breaks RFC's and likely will cause significant problems for you if you did
  • Gary
    Gary about 10 years
    Assuming the NS and SOA data is the same for the alias domain as it is for the canonical domain, is it possible to not have any NS and SOA records, and just have the one CNAME present at the alias domain's root? If possible, seems this would still satisfy the quoted statement from the RFC.
  • Brian Peterson
    Brian Peterson about 3 years
    What does "If a CNAME RR is present at a node, no other data should be present" mean? RR = resource record. "no other data should be present" = no other records using this domain? Would @Gary's suggested solution one comment above possibly work?