Question

Point the root domain to static website

Hello,

I already found some related information, but it don’t seem up to date.

I have a domain example.com and manage the DNS in digital ocean. ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com are configured to example.com. I also set up a CNAME for subdomain test.example.com for a web application.

Now I need to point the root domain, example.com, to a static website. I created a new app in digital ocean, connected to gitlab repository, and got the xyz-123.ondigitalocean.com domain. Now I thought I can just add another CNAME for example.com -> xyz-123.ondigitalocean.com. But the DNS Controlpanel won’t let me do this.

Can you please help me how to connect the root domain example.com to xyz-123.ondigitalocean.com?

Thanks in advance


Submit an answer


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!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
May 12, 2023
Accepted Answer

Heya,

For pointing your root domain to an App Platform app, you cannot use a CNAME record. Instead, you need to use an ALIAS or ANAME record. However, DigitalOcean’s DNS service does not support ALIAS/ANAME records currently.

As a workaround, you can create an A record pointing your root domain (example.com) to the IP address of the app xyz-123.ondigitalocean.com. Keep in mind that this method isn’t ideal since IP addresses might change. To obtain the IP address, you can use a tool like dig or nslookup.

Another option is to use a third-party DNS provider that supports ALIAS or ANAME records to manage your domain’s DNS.

For more information on managing DigitalOcean DNS, please visit our DNS documentation.

https://docs.digitalocean.com/products/app-platform/how-to/manage-domains/

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel