Preface
So I had a Digital Ocean droplet running and hosting my Jekyll site on an IP address that I could get to by typing in the IP address into the browser. I already had a domain name for an old site I was hosting on a friend's web server. So I need to get my domain name to point to the IP address of my Digital Ocean droplet and not the IP address of the old site. Below is how I did it.
Step One - Change Your Domain Server
Log into the control panel of your domain registrar. Meaning wherever you bought your domain, log into that control panel, be it a web server or an actual domain registrar, like NameCheap or Enom.
If you don't remember where you created your name, you can look it up by typing in the command prompt the command below:
whois mysite.com
So change the domain servers to match the DigitalOcean domain servers:
- ns1.digitalocean.com
- ns2.digitalocean.com
- ns3.digitalocean.com
To verify, hit up whois again and it should display the following:
Name Server: NS1.DIGITALOCEAN.COM
Name Server: NS2.DIGITALOCEAN.COM
Name Server: NS3.DIGITALOCEAN.COM
Step Two — Configure the Domain
Log into the Digital Ocean control panel and go to DNS. Add your domain name (don't add a www subdomain to the beginning, just the domain name).
On the next page you will add the subdomains — for example: yourdomain.com, test.yourdomain.com, and www.yourdomain.com.
Finished!!
That's it. It will take some time for the information to propagate. Wait a couple hours at least to check. You can test by typing the following command into a command prompt (assuming you created a test subdomain):
#ping test.mysite.com
PING test.mysite.com (12.34.56.789) 56(84) bytes of data.
64 bytes from 12.34.56.789: icmp_req=1 ttl=63 time=1.47 ms
64 bytes from 12.34.56.789: icmp_req=2 ttl=63 time=0.674 ms