How Do I Point My Domain to a DigitalOcean Droplet?
Connect your custom domain to a Droplet by updating DNS A records at your registrar or using DigitalOcean DNS for full control.
Overview
When someone types yourdomain.com in a browser, DNS tells their computer which server to contact. To point your domain at a DigitalOcean Droplet, you create an A record that maps the domain to your Droplet's public IP address.
Option A — DNS at Your Registrar
If you bought your domain from Namecheap, GoDaddy, Cloudflare, or another registrar, log in to their DNS management panel and add these records:
- Type: A Host: @ Value: YOUR_DROPLET_IP TTL: 300
- Type: A Host: www Value: YOUR_DROPLET_IP TTL: 300
The @ record covers the root domain. The www record covers www.yourdomain.com. DNS propagation can take anywhere from a few minutes to 48 hours, though most changes appear within 15–30 minutes.
Option B — Use DigitalOcean DNS
For tighter integration, move DNS to DigitalOcean:
- In the control panel, go to Networking → Domains and click Add Domain
- Enter your domain name and select your Droplet — DigitalOcean creates the A records automatically
- At your registrar, change the domain's nameservers to DigitalOcean's (shown on the domain page):
ns1.digitalocean.com,ns2.digitalocean.com,ns3.digitalocean.com
Verify the Change
Check whether DNS has propagated using:
dig yourdomain.com +short
nslookup yourdomain.com
Both commands should return your Droplet's IP. You can also use an online tool like dnschecker.org to see propagation status worldwide.
Configure Nginx for Your Domain
Once DNS resolves, update your web server. For Nginx, set server_name in your site config:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/html;
}
Test and reload: nginx -t && systemctl reload nginx
Common Pitfalls
- Typos in the IP address — double-check against the Droplet dashboard
- Old TTL values (86400) slow propagation — use 300–600 during setup
- Forgetting the
wwwrecord — visitors to www will fail unless you add it or redirect
After DNS is live, set up SSL with Let's Encrypt so your site loads over HTTPS.