Attach a Domain Name to the Static IP Address

Normally you want to make your Virtual Private Server in the Cloud accessible in the internet by a domain name. This article explains the basics.

With your cloud instance you normally get a static IP address attached to your instance for immediate access from the internet. And since the IP address is static, the address does not change when you restart your instance.

But the IP address is very technical and normally you use domain names, like www.airix.net, to get access to servers on the internet. The domain name system (DNS) of the internet will then get the IP address attached to the domain name and connect to the instance without you having to know the IP address.

The domain name system is maintained by a distributed database system, which uses the client–server model. The nodes of this database are the name servers. Each domain has at least one authoritative DNS server that publishes information about that domain and the name servers of any domains subordinate to it. The top of the hierarchy is served by root name servers, the servers to query when looking up (resolving) a top level domain (like .net or .com).

Your cloud provider may provide name servers to manage the domain's DNS records or you may use the name servers of your domain name provider (i.e. normally the company you have your domain registered with).

Cloud Provider Name Servers

When you want to use the name servers of the cloud provider, you need to maintain the domain name entry for your domain in the name servers and then register these new name servers with your domain name provider.

If you change a name server for your domain, it typically takes 24 to 48 hours before the change becomes effective world wide. This period, called propagation, is the length of time it takes for root name servers and cache records across the entire web to be updated with your website's DNS information. Because of propagation, some root name servers may still have the old information, while others are updated already. How quickly visitors are directed to the new name servers depends on their physical location, internet service provider and co-incidence. After 48 hours this propagation should be completed.

Domain Provider Name Servers

An alternative option (and the one that we are using at airix.net) is to use the name servers of a separate domain name provider. For this, you just need to update the DNS record (for IPv4 IP addresses the "A"-record of the entry) with the static IP address of the cloud instance.

The entry does also have a TTL value. A TTL value of 1800 seconds (30 minutes) would mean that, if a DNS record was changed on the name server, DNS servers around the world could still be showing the old value from their cache for up to 30 minutes after the change.

Once this was done and the TTL has expired (and you did not change the name servers), you can use the domain name instead of the IP address to access your server.

We at airix.net have our domain names registered with the domain name provider www.namecheap.com. Namecheap is a registrar for a lot of top-level domains and you can use their name servers to manage the DNS records you need.