How to point domain to Droplet on DigitalOcean
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
Log in to DigitalOcean Control Panel
cloud.digitalocean.com and sign in to the control panel. This is your starting point for all Droplet and networking management.Update Nameservers at Domain Registrar
ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com. Save changes; propagation takes 1-48 hours, typically 1-24 hours.Add Domain in DigitalOcean Networking
yourdomain.com) in the Add a domain field and click Add Domain. Note the displayed nameservers for verification.Find Your Droplet's IPv4 Address
104.248.xxx.xxx). This IP will be used in DNS records.Create A Record for Root Domain
A, Name/Hostname = @ (root domain), Value/Target = Droplet's IPv4 address (or select Droplet from dropdown), TTL = default (3600 seconds). Click Create Record.Create Record for www Subdomain
A, Name = www, Value = same Droplet IPv4, TTL = 3600. Or use CNAME: Type = CNAME, Name = www, Value = yourdomain.com or @. Click Create Record.Verify DNS Propagation
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.Configure Web Server on 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.Optional: Add MX Records for Email
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.