I have bought a domain domain.com 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 sub.domain.com, www.sub.domain.com, domain.com or www.domain.com in a browser, I want the url to become sub.domain.com 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
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!
Assuming your IP address is 178.62.x.y, I’d create the following records:
domain.com. A 178.62.x.y
www.domain.com. CNAME domain.com.
sub.domain.com. CNAME domain.com.
www.sub.domain.com. CNAME domain.com.
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.