This is a story about the host provider, DigitalOcean, and how it interacts with Ghost, the publishing platform.
We were asked to use DigitalOcean as our host provider. DigitalOcean is a cloud hosting provider, meaning that it uses many servers rather than a single machine. Thus reducing the risk and dependency on a single server. Cloud servers run on virtual servers which are similar to a physical server however software based making it easier to create and configure. Since cloud servers share segments on many servers, one physical machine can run many virtual machines(VM), reducing the costs and ensuring higher security. By using virtual machines you can share hardware resources more efficiently. DigitalOcean cutely calls their virtual server a ‘droplet’.
By creating a droplet (virtual server or virtual machine), we have created our very own server with public IP Address! This is an identification code that computers use to find each other.
Actually computers find each other in a similar way as we find people though using a street address.
Computers can use the IP address to route your request to a specific site but we, humans, aren’t as smart as computers and are significantly lazier. For example, the IP address for this website is 104.131.24.149, and if you were to type that into the the browser you will end up at the same place as if you were to type uitblog.com (the domain name). But between the two of it is much easier to remember uitblog.com than 104.131.24.149. It’s similar to saying "lets meet up for drinks at Carol’s place" rather than saying “lets meet up for drinks at 6894 Adanac Street”. We are merely simplifying the instructions that we have to remember.
Let's say that I tell you to meet me at Carol's but you don't know her address. Well that is what the Domain Name Server (DNS) does. It matches up all of the names (or domains) to all of the addresses (IP Addresses). This will be explained a little later but first we will look at domain names.
All domain names must be unique or else it would be confusing (like that time you thought you were stood up, only to realize that they were waiting for you at the Starbucks across the street).
In order to prevent these issues, each domain name must be unique and therefore registered in order to keep track of and prevent duplications. I used Amazon's Route 53 to register my domain name, however there are many other options including (ie. GoDaddy, HostGator etc.). The registrar, Amazon, checks the availablity of the domain name with ICANN who runs it against a central database. If your domain name is available, it will be registered and added to the whois database.
So now we have our IP Address (104.131.24.149) and a unique and memorable domain name (uitblog.com). But how do we get uitblog.com to equal 104.131.24.149?
Well similarly to 6894 Adanac Street becoming Carol’s, we have to buy the domain name, move in, and let people know our new address. The Domain Name Server(DNS) translates the domain name to the IP Address. Just like when you move homes and need to tell Canada Post of your forwarding address, the DNS manages and maps out all the addresses (IPs) with people (domain names). Luckily, it is not Canada Post and is significantly more effective!
Using the DNS servers from the registrar (Amazon) means you’ve “moved in” or have a parked domain.
In order to move in we must modify the information in the DNS server, this is done through the “Hosted Zone”.
So for me this was really confusing at first. But the housing analogy has been working so far for me so I tired to think of it in moving terms. You have a new address and you want to tell the post office. You must:
- Give them your name and the address (A)
- Give them your phone number (how can they reach you) (NS)
- This I imagined as similar to coordinates of my house. They already have this and tell you what it is (you don’t need to worry about this) (SOA)
So you need to change your Host(A) to match your IP Address (where they can physically reach you). You also need to change your NS to the name servers of how you want them to reach you (which servers are you using). Imagine you hired a personal assistant. Instead of giving your own phone number as the (NS), you want to give your assistant's number (who can screen your calls, weed out the annoying uncle and the telemarketers).
Our personal assistant is Cloudflare, it will track and screen our visits, to improve our security and speed. We have to tell Cloudflare what it is protecting and where it is located (our domain name and IP Address). Cloudflare then returns two name servers(the phone numbers) which we must input into the Host Zone’s NS section at the DNS provider. We go to Amazon(our DNS provider) and replace the NS to the two name servers that Cloudflare provided us. We have now setup Cloudflare to take care of all the grunt work we don't want to do.
comments powered by Disqus