Redirect everything to a sub domain

I have bought a domain from GoDaddy. In GoDaddy, I have customised DigitalOcean as name servers.

I would like to customise DNS of DigitalOcean to realise this: If I enter the urls,, or in a browser, I want the url to become in the browser, and the browser shows the site in my server IP 178.62.x.y.

Because of the jet lag and DNS cache issue, it is hard to try and test a setup (hard to say if it is a wrong setup or just need to wait). So could anyone give me a full list of records (A, CNAME…) to realise this?

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.

Assuming your IP address is 178.62.x.y, I’d create the following records: A 178.62.x.y CNAME CNAME CNAME

You technically could create four A records instead, but an advantage of the above is that if your IP ever changes, you’ll only need to update one DNS record.

You’ll also need to configure your web server to perform the appropriate redirects.