Make domain url lead to subdomain

I have bought a domain from GoDaddy. In GoDaddy, I have customised DigitalOcean as name servers; in DNS of DigitalOcean, I have added the following records:

| | | ------------- | ------------- | ------------- | A | @ | 178.62.x.y CNAME | sub | CNAME | www.sub |

As a result, when I type and in a browser, they both lead to, which is what I want.

Currently and lead to the default site of my server. However, I also want them to lead to

Does anyone know what to do to make this happen?

Thank you

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.

Yes, just change your A record with the name to 178.62.x.y Then create the CNAME so will get redirected to sub. and that will redirected to your servers ip

I don’t get your setup, because now you redirect to and you want to redirect to ? But anyway, if you want to just use a cname for it and it will work. Name: Hostname: