Ahhh DNS. It’s been around since the early 80s and despite being widely used, I still run into basic questions about the technology and thought a simple blog posting would be useful to level-set DNS for the newbie.
So what is DNS? Well, DNS – the Domain Name System – is like the phonebook of the internet. Want to catch up on the news at www.cnn.com? DNS helps with that. Want to send an email to Auntie Agnes in Anchorage, AK? DNS helps with that. Calling a colleague on Skype? DNS helps there too.
DNS is a hierarchical domain name-to-IP address database (and to the purists who are reading this, yes, it does far more than this but this is a simple blog post). At its essence, it will translate www.nominum.com into 188.8.131.52 and 184.108.40.206 into www.nominum.com.
It’s designed to be distributed and fault-tolerant. The administration and maintenance is delegated to groups worldwide. With that in mind, a domain is a concatenation of names (labels) assigned to an entity to help navigate this hierarchical system (for example, nominum.com).
There are two main camps in DNS – those who ‘publish’ data and those who ‘read’ it. This is referred to as authoritative and recursive DNS, respectively.
Authoritative DNS refers to DNS servers that are authoritative for zones – for example, we have DNS servers that are authoritative for nominum.com. This means that from anywhere on the internet, if you need to know where www.nominum.com is, a recursive server will end up querying one of the authoritative nominum.com name servers for the answer.
Recursive DNS refers to the servers that search the internet looking for answers to questions that have been asked. These are the DNS servers that most everyone uses. (I’m using DNS servers right now through the airport Wi-Fi I’m on.) When they first start up, these recursive servers know only how to get to the root name servers. The root name servers only know how to point to the top-level domain name servers (.com, .org, .ca, etc.). With this information, the recursive servers are able to navigate the DNS in order to find answers to the queries that are asked of them.
DNS itself is comprised of domains, zones and records within the zones.
A domain is something like nominum.com and everything under it (www.nominum.com, mail.nominum.com, internal.nominum.com, etc.).
A zone can be nominum.com, or we can break it up into sub components called zones as well. For example, we could have nominum.com as a zone and internal.nominum.com as its own zone.
Records are data in the zone. For example, a record for www.nominum.com could look like this:
This record has more than just a name and IP address – it also has a Time to Live (TTL), Class and Record Type. The Time to Live is 3600 seconds and this is how long the recursive server caches the data for. IN tells us that it’s an Internet record. A tells us it’s an Address Record (ipv4).
TTLs vary in size – some for CDNs are short, like 30 to 60 seconds; other are long and can be days or weeks in length.
There are many record types. Some common ones include:
- Address Records (A) ipv4 addresses
- Quad A Records (AAAA) ipv6 addresses
- Mail Exchanger Records (MX)
- Name Server Records (NS)
This only scratches the surface of what DNS does, and other topics pertaining to DNS will appear on this blog in the coming weeks addressing things like policy and security. Stay tuned!