How to correctly set subdomain on Digital Ocean

  • Posted February 10, 2015


It looks like I’ve got myself in a muddle. I have a website hosted with Hetzner and they currently have the zone file.

I would like to set up a subdomain.mydomain at digital ocean.

I have the virtual hosts and so on correctly set up on my droplet and have added subdomain.mydomain to my digital ocean account.

I then added a new CNAME record:

subdomain CNAME digitaloceanIP

I think that’s where I’ve gone wrong?

I havent added the @ record they provided because I’m paranoid its going to overwrite or cause a conflict with my other services. (Note to self, spend more time understanding the zone file.)

What is the correct way to set this up so that it doesnt disrupt my other services and so forth?


That correct above no longer useful. Guess it ended up below. God I hate the way this board works.

Screenshot not showing any subdomains.

But you need something along the lines of

Name IP Address

would give you the subdomain for in addition to both pointing you your ip Nginx or Apache config files would then sort out the correct site to display.

See for nginx

See for apache

See for general DNS and for setting up DO DNS

Hopefully they will explain it better than me.

Thanks that got me pointed to my Digital Ocean account but the subdomain nows routes to the other site hosted on the server.

The .conf file seems to be correct. Are any additional changes required on Digital Ocean?

This is what the domain settings look like on Digital Ocean

So would I set it as follows:

Remove the CNAME record.

Change the A record as follows:

subdomain A mydigitaloceanIP


Submit an 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.

Think you just want an A record here.

CNAME will never be an ip address it will always point to an A record.