Report this

What is the reason for this report?

How to create a CNAME Record for the root domain?

Posted on October 11, 2019

Hello.

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

I’ve already looked at this tutorial here: https://www.digitalocean.com/docs/networking/dns/how-to/manage-records/

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: example.com is an alias of foo.whatever.com

Thanks for the help !



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @timoDjatomika,

Did you try putting example.com in instead of the @ sign?

I hope this helps! Bud Manz

Hey, @timoDjatomika

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

According to this blog post: https://www.freecodecamp.org/news/why-cant-a-domain-s-root-be-a-cname-8cbab38e5f5c/

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???)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.