Question

How can I point my domain to a DigitalOcean Droplet using the DigitalOcean DNS?

Hi everyone,

I recently set up a Droplet on DigitalOcean, and now I’m trying to point my custom domain to the Droplet using DigitalOcean’s DNS management. What steps should I take to configure the domain properly?

I’ve already registered the domain with an external domain registrar, but I’m not sure how to set the correct DNS records and which ones are necessary for both the website and email. Any advice on the types of records I need (A, CNAME, MX) and how to configure them would be really helpful!

Or shall I use my domain provider to handle my DNS records?

Thanks in advance!


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.

Bobby Iliev
Site Moderator
Site Moderator badge
October 5, 2024

Hey there! 👋

You’re on the right track! Pointing your domain to a DigitalOcean Droplet using DigitalOcean’s DNS is pretty straightforward.

First, head over to the DigitalOcean Control Panel and click on “Networking” in the left-hand menu. Then, under the Domains tab, add your custom domain (e.g., yourdomain.com) by typing it in the box and clicking “Add Domain”.

You’ll need to point your domain’s nameservers to DigitalOcean’s. Go to your domain registrar’s control panel (where you bought your domain) and update the nameservers to:

ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com

This might take a little while to propagate, so don’t worry if it’s not instant.

Next, in the DigitalOcean Networking tab where you added your domain, you’ll need to create an A Record that points to your Droplet’s IP address. Here’s how:

  • Type: A
  • Name: @ (this means the root domain, like yourdomain.com)
  • Value: Your Droplet’s public IPv4 address
  • TTL: Keep the default (3600 is fine)

Click Create Record after you’ve filled in these fields.

If you have subdomains or email services, you might need to add more DNS records:

  • CNAME Record: For subdomains, like www.yourdomain.com, create a CNAME record:

    • Type: CNAME
    • Name: www
    • Value: yourdomain.com
  • MX Records: If you’re setting up email, make sure to add MX Records provided by your email hosting provider.

DNS changes usually take some time to propagate. You can use tools like WhatsMyDNS to check if the changes have taken effect globally.

If you’re worried about security, you can also use DigitalOcean Cloud Firewalls to restrict access to your Droplet. It’s super easy to set up and allows you to control inbound and outbound traffic.

You can find more about it here:
DigitalOcean Firewalls Documentation


Let me know how it goes, and feel free to reach out if you need any more help! 😄

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.