TemperStack
Intermediate12 min readUpdated Mar 13, 2026

How to point a domain to a Droplet on DigitalOcean

Quick Answer

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

Prerequisites

  1. DigitalOcean account with a created Droplet (note its public IPv4 address)
  2. Registered domain from any registrar (e.g., Namecheap, GoDaddy)
  3. Access to your domain registrar's control panel
  4. Basic familiarity with DNS concepts
  5. Optional: SSH access to Droplet for web server setup
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.
Tip
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.
Tip
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.
Tip
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.
Tip
@ represents the apex/root domain like yourdomain.com.
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.
Tip
CNAME for www 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.
Tip
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.
Tip
Test locally with curl -H "Host: yourdomain.com" localhost 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.

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 ipconfig /flushdns (Windows) or restart resolver; check for conflicting records.
www subdomain not working
Ensure CNAME points to @ or root domain (not IP directly); delete any conflicting A record for www; wait additional propagation time.
Getting 'connection refused' when visiting domain
SSH to Droplet and confirm web server (nginx/apache) is running: systemctl status nginx; check firewall allows ports 80/443: ufw status; 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.

Related Guides

More DigitalOcean Tutorials

Other Tool Tutorials

Ready to get started with DigitalOcean?

Put this tutorial into practice. Visit DigitalOcean and follow the steps above.

Visit DigitalOcean