Question

Is it possible to use a sub-domain as the primary domain for a droplet?

Hi all, Is there a way to set a sub-domain as the primary domain? is it’s possible, can we setup this as a sub-domain per a droplet? Like this,

Main domain: example.com

example.com     => droplet_1
foo.example.com => droplet_2
bar.example.com => droplet_3

Any suggestion/idea would be helpful. 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.

Hello,

Yes, this should not be a problem at all.

All that you would need to do is to:

  • First create a Droplet
  • Get the Droplet’s IP address
  • Then go to your DNS zone
  • Add an A record for the specific subdomain to point to the Droplet’s IP address

Then within a few hours, once the DNS cache clears over the Globe, you will be able to see the new A record:

https://www.digitalocean.com/community/tools/dns

Hope that this helps!

Best,

Bobby