Report this

What is the reason for this report?

How to change root entry to CNAME for github pages?

Posted on January 28, 2017

I am trying to move from NameCheap to DigitalOcean. My DNS is amirraminfar.com. Currently, in NameCheap I have amirraminfar.com setup as a CNAME to amir20.github.io.

$ dig amirraminfar.com
;; ANSWER SECTION:
amirraminfar.com.	1587	IN	CNAME	amir20.github.io.

When trying to do the same thing in DigitalOcean, I cannot change amirraminfar.com to CNAME because @ seems to be invalid.

Is this a known problem? Perhaps, it is not possible to setup a root as CNAME but then why is it working on NameCheap.



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.

I’m sure you’ve found an answer for this already - but I’m leaving this here for anyone looking here in the future.

The best available solution is CloudFlare, it’s a free DNS service that offers “CNAME Flattening” which allows you to place CNAME records at the apex/root of the domain.

They also provide free SSL which is nice.

@amirraminfar

Since DigitalOcean doesn’t support ALIAS or ANAME records (as far as I can see), which is required by GitHub in order to setup your domain if you want to route the domain itself, then you may have to fall back to your default registrars DNS and use them (if they support it).

The only other way would be to use an A entry and point that entry to the IP used by your page. The downside to this is, unlike ALIAS and ANAME entries, if GitHub changes their IP, you have to do the same, otherwise your page won’t display.

I’ve honestly not seen too many providers that do allow such entries though, so it’s not just a limitation here at DigitalOcean.

You could, of course, use a sub-domain and use a CNAME to point it, but as far as the actual domain and only the domain, you need a way to use those entries and DigitalOcean currently does not allow them to be setup from the control panel.

Hmm. Well that’s a bummer. I created an ticket for DO. If they don’t provide a solution, I’ll have to leave it at NameCheap for now.

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.