Quick update: if you need a primer on domains in general, check a magnificent resource that Alejandra has sent me. Many thanks!
Most of the developers sooner or later will have to buy a domain for one of their projects, let it be hobby or commercial. I had this problem recently and most solutions that I’ve found were lacking, so I thought of this tutorial.
I assume that you have already bought a domain at Domain.com and have created a droplet on DigitalOcean. Let’s start, shall we?
DigitalOcean’s end
On your project’s page, select Add a domain
frtom a dropdown menu:
Enter your domain name (I’ve used domain-tutorial.com
for an example) and hit Add domain
:
Everything should be mostly fine at this moment. Add a new A
record with www.
prefix, then hit Create record
:
Your DNS records
should look like this:
Domain.com’s end
For this part of the tutorial I’ll use my pre-existing gogpicker.com domain. In case you’re interested, it’s for my hobby project for Reddit. It aids users of r/GiftofGames subreddit in picking winners of Steam giveaways.
In your user panel, click on Manage
next to your domain:
From the menu on the left select DNS & Nameservers
.
Click on Add a nameserver
. You need to add 3 nameservers:
- ns1.digitalocean.com
- ns2.digitalocean.com
- ns3.digitalocean.com
The last step is to remove domain.com
DNS as they are no longer needed:
Everything is set. Now you have to wait up to 48h for DNS to propagate and your changes will take efect.