In short, the DNS records for the domain you wish to deploy to need to point to the IP address of the server you setup with cods.
You could do this in a number of different ways, but this guide will give one version of how to do so.
-
From your domain registrar (i.e. the company you bought the domain from) point the DNS nameservers for that domain to digital ocean.
We will detail the process for namecheap here, but other registrars will be similar.
-
Go to your dashboard and click the "manage" button next to your domain
-
Under "nameservers", change from "BasicDNS" to "custom"
-
Enter in the following nameservers:
ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com
-
Make sure to click the green check mark to apply the changes
-
This process will cause all requests for your domain to go to your server.
-
Add your domain (without the
www
orhttp
) under "Add a Domain" -
Under "Create a New Record" choose the "A" record (this should be selected by default)
-
For the hostname, enter
@
-
For "will direct to", choose your droplet
-
Leave the default TTL
-
Click the "Create Record" button
A simple way to have any and all subdomain requests go to the same place as your server is to do the following
-
Create a new record for your domain
-
Choose "CNAME" for the record type
-
For "Hostname", enter
*
-
For "Is an Alias Of", enter "@"
-
Leave the default TTL
-
Click the "Create Record" button
More advanced configuration, for example, wanting a specific subdomain to go to a different IP address, is beyond the scope of this guide.