Question

How to structure DNS records for domains with sub-domains

  • Posted on September 3, 2014
  • ImpalooAsked by Impaloo

Hey. Let’s say I have a domain domain.com.

I want all traffic to domain.com to be redirected to www.domain.com (this redirection is done from my web server).

I also want to have custom sub-domains such as william.domain.com.

As of now, my DNS records looks like this.

Is this the correct way of doing it (notice the trailing dot(s))?


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.

If all your subdomains are at the same IP address as the root domain, the simplest set up is to just create a wildcard CNAME:

Check out this tutorial:

How To Set Up and Test DNS Subdomains with DigitalOcean’s DNS Panel