-4

I recently bought a new domain from namecheap and decided to delegate it to Yandex.Connect services, so I changed namecheap's DNS to custom, added Yandex' nameservers (dns1.yandex.net and dns2.yandex.net) in the control panel, added the proof and within a couple hours my domain was being managed by Yandex.

Since I am hosting a personal site in my own premises and since my ISP doesn't sell any static IPs I decided to use DDNS. But when I tried to add a CNAME for @ that points to my-domain.example-ddns.org I found out it does... nothing. The record just isn't being created. I tried adding another one for a subdomain and it works perfectly fine.

After reading Yandex' guides I read this:

CNAME. Remember that a CNAME record can't be set up for the domain root, because this is prohibited by the RFC.

Imagine my shock when I read such a thing, when at the same time I have another domain registered with namecheap, but using namecheap's basic DNS instead, where I set up a CNAME record for @ that points to my-other-domain.example-ddns.org and it works perfectly fine!

How do I work around this? Using an A record is a no-go since I can't get an static IP.

  • Why the downvote, though? Does this not belong in here? At least point me in the right direction – arielnmz Sep 16 '18 at 23:21
  • Agreed. A downvote without commenting is rather pointless. – guzzijason Sep 17 '18 at 0:23
2

There is no easy way around this. Per RFC 1912:

2.4 CNAME records
    A CNAME record is not allowed to coexist with any other data.

However, the apex of any zone MUST contain other data, such as SOA and NS records, which is why a CNAME cannot exist at the top.

Therefore, you generally have to resort to an A record rather than a CNAME; there are exceptions to this, however, in cases where the domain is being hosted by server capable of dynamically generating the A records. For example, EasyDNS has a way around this using a proprietary implementation of an "ANAME" record, described here. A standard, RFC-compliant nameserver will not support this feature directly, however.

  • So if I was able to add a CNAME record for host @ with a value of my-domain.example-ddns.org, it means Namecheap is doing something like what you say under the hood? – arielnmz Sep 16 '18 at 23:37
  • I'm not so sure. Even namecheap's own documentation says you shouldn't do this. If you have, and it works, it may just be luck. – guzzijason Sep 16 '18 at 23:42
  • Case closed, then – arielnmz Sep 16 '18 at 23:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.