Developer of the interwebs, advocate for technology for good and awesome, enjoyer of fine ales and good food.
30 Jul 2014
Wondering why I'm blogging about this? Read more about my quest for badges!
Earlier, I explored how DNS works and explained how I chose my hosting. I'm now going to dive into how the two click together. This is all to do with the bit around Step 7 in my post on DNS, the actual step where something takes responsibility for a domain and provides the relevant information.
For this, I'm going to talk about my domain
nickjackson.me, because it covers two of my three hosting flavours as well as a couple of other interesting bits of DNS goodness. The domain is registered with 123-reg, but I've opted to actually have the DNS handled by PointDNS. This is a handy thing to know in the world of domains and hosting; although the huge majority of domain registrars will offer their own DNS services which will suffice for the vast majority of cases, if you want to you can take your DNS elsewhere like I have done.
Here's a snippet of my current DNS configuration:
As you can see, there are a few different types of record in there. The most common ones, the ones which you'll most likely run into, are the
CNAME records. DNSimple have a nice explanation of the differences between
URL records which all serve a similar purpose in different ways. There are loads of types of DNS record which can exist, ranging from simple 'go here' records through to ones used to route email, declare security policies and do all kinds of other things.
A records, at the top of the list, are the ones which my explanation of the DNS system is really about. These are the ones similar to a telephone directory, which directly say things like "the domain name
alice.nickjackson.me is at IP address
220.127.116.11". You will note that
duchy.nickjackson.me are pointing to the same IP address; this is my Rackspace server mentioned in my post on hosting.
A quick aside, you will also spot
AAAA records for
duchy as well, pointing to a long string of letters and numbers. This is an IP address as well, except an IPv6 address instead of the more common IPv4. There is a limited number of IPv4 addresses to go around, and they have nearly all been used up. IPv6 provides an awful lot more addresses, 2128 addresses to be exact. This is a number so big that I'm not even going to try compare it to anything. I really encourage you to take a quick look into this, since this is one of the biggest problems facing the Internet today.
Back to DNS, you will also spot
CNAME records. This is shorthand for "canonical name", and pretty much says "for everything you want to know about this domain, go look at that domain instead". They're commonly used for making sure the
www. part of domains work. They're also commonly used, as many of mine are, for allowing people to have 'custom domains' for various other services. For example, I have a Tumblr which is accessible at tumblr.nickjackson.me, but this is actually pointed at
domains.tumblr.com. This means that Tumblr can retain control of things like the IP addresses which are in use without me needing to worry, so if they ever move servers (not an entirely uncommon thing) then my Tumblr will continue to work happily.
Finally, there's an
ALIAS record. These are a relatively new addition to the DNS scene and as such aren't supported by all DNS services. An
ALIAS record behaves much like a
CNAME in that it refers people to another domain, but they only affect the specific query being made. They also play nicely if used on apex domains (ie those without any subdomains), which means that I can use an
ALIAS record instead of
AAAA in hosting this website you're reading right now.
As I mentioned above, this isn't an exhaustive list. There are far more kinds of DNS records which do all kinds of clever things, but this should be an overview of the most common kinds you'll run across in hosting a simple website.