How to create a CNAME Record for the root domain?

Posted October 11, 2019 27.7k views


My question is how to create a CNAME Record for the root domain “”.

I’ve already looked at this tutorial here:

They wrote that I should use the “@” sign. Unfortunately when I try the “@” sign in the Hostname field I get the error: “Invalid Hostname”.

I wanna create the following alias: is an alias of

Thanks for the help !

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers


The reason you can’t enter it in the interface is because the DNS standard doesn’t allow CNAME for the root record. Root record always has to be A.

See more:

To consolidate your records people usually go the other way.... is an alias of

  • Then how do we point the domain name without “www” to a host without a static ip? for example AWS elastic load balancers have hostnames like but their ids are not guaranteed to stay same.
    Any solution for this scenario?

    • Hi, raw DNS definitely doesn’t allow this. So the solution is basically some service which will update the A record automatically. You could call some digital ocean API yourself to update it from the server on some regular basis. Or you could use some DNS service which does this on your behalf, someone mentions below Namecheap does it, if you use Amazon route 53 they have “alias” record. Cheers, good luck

I’ve this Option in Namecheap…

But in Digital Ocean, they won’t allow us to Create CNAME for Root Domain.

if Your Domain is in Namecheap or any Domain Panel…

And Hosting is in Digital Ocean…

Then, I would suggest you to…

Remove Your Digital Ocean NS1, NS2, NS3 DNS Values ( Name Servers ) from Domain Panel…

Then, Create A Records to Your Digital Ocean Server IP

Also, Create CNAME from your Domain Panel…

Majority of the People, Including me…

Buying Domain from Namecheap, and from there Creates Name Server for Digital ocean to point Domain to the DO Server.

And Then, We Create All Values in Digital Ocean Panel…

That’s Good in some cases, but when we face issues like this… the old school method is Good…

Hi @timoDjatomika,

Did you try putting in instead of the @ sign?

I hope this helps!
Bud Manz

  • Hey. Thanks for the answer.

    Unfortunately that does not work.

    Then it will get is an alias of


    • Okay, I think I understand now… so you are wanting to point to another domain. In that case, the @ should reference the domain you want to go to. For example, if you want to be pointed at, then would be the @. I am not entirely sure this is possible.


Hey, @timoDjatomika

Could you please let me know if you want to set as alias of or the other way around?

  • I simply wanna use cloudfront for my domain Therefore I have to create a CNAME Record that refers to another domain. Lets say

    I just cloud create the record for But this is not what I want.
    The main content should be provided by

    Also the CNAME’s for and are not the same.

    This should be somehow possible because of the tutorial described in my initial question. I just can’t use the “@” symbol (tried in different web browsers).

    Furthermore I successfully created a CNAME for with cloudflare. So technically this shouldn’t be a problem.

According to this blog post:

I shouldn’t use the CNAME for the root domain. Some DNS Providers implemented a workaround (e.g. Cloudflare) so thats the reason why it worked for my other domain (using Cloudfront to host a website and Cloudflare as my DNS Provider).

I think digitalocean decided not to implement such a workaround because of reasons that I don’t know (maybe they wanna stick to a standard???)