Question

Use a domain across multiple projects

I have several projects configured in DO, each representing an environment of my app (dev, staging, prod). I have one domain. I would like to set up DNS so that subdomains point at different environments (dev.mydomain.com, staging.mydomain.com, mydomain.com).

I see in the DO dashboard where to add a domain, but it looks like it wants to associate a domain with an individual project. Is there a way to set up DNS so that one domain can be used across projects?


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @proconnectapp,

All you need to do is to create a subdomain and point it to your Droplet/Project. Associating the domain with a project won’t stop you from doing that so do not worry.

In regards to other configurations, please do let me know if you need any other assistance.

Hii @proconnectapp,

What webserver are you using, Apache or Nginx?

You can solve it using Virtualhost, basically it is a way to virtualize a host.

Nginx - How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04

Apache - How To Set Up Apache Virtual Hosts on Ubuntu 16.04

Hope that helps ;)

Sergio Turpín