How to point domain to Droplet on DigitalOcean

intermediate 12 min read Updated 2026-03-13
Quick Answer

Update your registrar's nameservers to <code>ns1.digitalocean.com</code>, <code>ns2.digitalocean.com</code>, <code>ns3.digitalocean.com</code>; add domain in DigitalOcean Networking > Domains, create A record for <code>@</code> pointing to Droplet IP, optionally CNAME for <code>www</code>; wait 1-48 hours for propagation while ensuring web server runs on ports 80/443.

Prerequisites

  • DigitalOcean account with a created Droplet (note its public IPv4 address)
  • Registered domain from any registrar (e.g., Namecheap, GoDaddy)
  • Access to your domain registrar's control panel
  • Basic familiarity with DNS concepts
  • Optional: SSH access to Droplet for web server setup

Step-by-Step Instructions

1

Log in to DigitalOcean Control Panel

Access your DigitalOcean account at cloud.digitalocean.com and sign in to the control panel. This is your starting point for all Droplet and networking management.
2

Update Nameservers at Domain Registrar

Log in to your domain registrar's control panel (e.g., Namecheap, GoDaddy). Find the nameserver settings for your domain and replace existing nameservers with DigitalOcean's: ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com. Save changes; propagation takes 1-48 hours, typically 1-24 hours.
Check registrar-specific guides if nameserver update process is unclear.
3

Add Domain in DigitalOcean Networking

In the DigitalOcean control panel left menu, click Networking then Domains tab. Enter your domain name (e.g., yourdomain.com) in the Add a domain field and click Add Domain. Note the displayed nameservers for verification.
If domain has non-ASCII characters, convert to Punycode first.
4

Find Your Droplet's IPv4 Address

Navigate to Droplets in the left menu, select your Droplet. Copy the Public IPv4 address from the overview page (e.g., 104.248.xxx.xxx). This IP will be used in DNS records.
Use IPv4 unless your setup specifically requires IPv6 (AAAA record).
5

Create A Record for Root Domain

Return to Networking > Domains, select your domain. Click Add Record and configure: Type = A, Name/Hostname = @ (root domain), Value/Target = Droplet's IPv4 address (or select Droplet from dropdown), TTL = default (3600 seconds). Click Create Record.
<code>@</code> represents the apex/root domain like <code>yourdomain.com</code>.
6

Create Record for www Subdomain

In the same DNS records section, click Add Record. For A record: Type = A, Name = www, Value = same Droplet IPv4, TTL = 3600. Or use CNAME: Type = CNAME, Name = www, Value = yourdomain.com or @. Click Create Record.
CNAME for <code>www</code> is recommended as it follows the root domain automatically.
7

Verify DNS Propagation

Use tools like WhatsMyDNS.net or dig yourdomain.com to check if your domain resolves to the Droplet's IP globally. Propagation varies by location; allow up to 48 hours but expect 1-4 hours typically.
Test from multiple global locations for full propagation confirmation.
8

Configure Web Server on Droplet

SSH into your Droplet:
ssh root@your-droplet-ip
Ensure web server (Nginx/Apache) is installed and configured for your domain. Update server blocks to listen for yourdomain.com and www.yourdomain.com on ports 80/443. Refer to DigitalOcean LEMP/LEMP tutorials.
Test locally with <code>curl -H "Host: yourdomain.com" localhost</code> before going live.
9

Optional: Add MX Records for Email

If using email services, in DNS records section click Add Record and add MX records from your email provider (e.g., Google Workspace, Mailgun). Set Type = MX, appropriate priority, and target hostname.

Common Issues & Troubleshooting

Domain not resolving to Droplet IP after 48 hours

Verify nameservers at registrar match DigitalOcean's three NS records exactly; flush local DNS cache with <code>ipconfig /flushdns</code> (Windows) or restart resolver; check for conflicting records.

www subdomain not working

Ensure CNAME points to <code>@</code> or root domain (not IP directly); delete any conflicting A record for <code>www</code>; wait additional propagation time.

Getting 'connection refused' when visiting domain

SSH to Droplet and confirm web server (nginx/apache) is running: <code>systemctl status nginx</code>; check firewall allows ports 80/443: <code>ufw status</code>; verify server block has correct ServerName.

Nameserver changes not accepted by registrar

Confirm domain is unlocked and not in transfer/renewal status; use exact DigitalOcean NS names without typos; contact registrar support if restrictions apply.

DNS records show but site shows wrong content

Clear browser cache and CDN cache if using one; check Droplet server logs for correct virtual host matching; verify no trailing dots in record values.

Limited Time

Affiliate link. We may earn a commission at no extra cost to you.