Hello, and welcome to the LinuxAcademy guide to DNS! This is going to be a quick “crash course,” so please buckle your seatbelts and keep your arms and legs inside the vehicle at all times!
What is DNS?
DNS, or “Domain Name System,” is one of the most important parts of The Internet today. DNS is essentially a server or hierarchical configuration of servers that acts as a “phone book” for a network. DNS translates a hostname (name of a computer) to an IP address (“phone number” of a computer).
If you type https://linuxacademy.com in your browser, your browser doesn’t see it as words like we see it. Your browser sees the IP address, just as when you select a contact in your cellphone, your cellphone sees a phone number.
Every networked device, including webservers, phones, computers, modems, routers, even smart lightbulbs and stoves has an IP address. Since humans aren’t as good with numbers as computers are, we invented DNS to translate these numbers into domain names and hostnames that make much more sense to us.
Exercise: Find Google’s IP address using its domain name!
1.Open the terminal or command prompt of your operating system.
a.For Windows: click on your start menu, type “Powershell” and hit “enter”.
b.For OSX: Click on the “Spotlight” magnifying glass and type “Terminal” and hit “enter”.
2.Once you have the utility up, type:
(Linux and OSX users, press ctrl+c to stop the pings after you have seen a few.)
You should see output similar to this:
[root@localhost ~]# ping google.com -c 4
PING google.com (220.127.116.11) 56(84) bytes of data.
64 bytes from lga25s40-in-f14.1e100.net (18.104.22.168): icmp_seq=1 ttl=55 time=21.1 ms
64 bytes from lga25s40-in-f14.1e100.net (22.214.171.124): icmp_seq=2 ttl=55 time=17.1 ms
64 bytes from lga25s40-in-f14.1e100.net (126.96.36.199): icmp_seq=3 ttl=55 time=22.0 ms
3.As you can see, this translates an easy to remember domain name “google.com” into an easy for a computer IP address “188.8.131.52”.
How Internet DNS works
Anatomy of a DNS Name Server
A DNS Name Server is just a computer. It might be a very small computer, such as a Raspberry Pi, or it might be a giant pool of clustered server nodes. The only requirements for a server to be a DNS server is that it translates Domain Names to IP Addresses. DNS servers typically run a DNS server software such as Bind or Microsoft DNS. These servers can host simple “Static DNS” records that must be modified manually or they can dynamically update their DNS records based on queries they are asked to perform. If a DNS server does not have a particular record, it can reach out to another DNS server to ask it. If this DNS server has the information, the DNS server that initiated the query can then update its own database, or cache, in order to prevent it from having to ask again.
Anatomy of a URL or FQDN
A “Uniform Resource Locator,” commonly known as a “URL,” has a few different parts that will help make DNS easier to understand.
Note: There is also a dot at the end of a URL that is typically hidden. This simulates the “root servers.” You can see this dot when creating new zone records, a process that will be explained later.
A “zone” is a domain name for which the server answers queries. Zones can get very complicated, but essentially, there are Primary and Secondary zones. A Primary Zone is a zone for which the server is “authoritative.” This means the server has the final say in the DNS records it hosts. A Secondary Zone is a zone for which the server can respond, but does not have the final say. It must communicate with the Primary zone to ensure its records are correct. Having multiple DNS servers helps keep the DNS network resilient to attacks and failures.
Root Servers and the DNS chain of command
At the top, you have a relatively small number, 13 at the time of this writing, of companies that operate the “root” servers. The group of hundreds of servers known as “Root Servers” are responsible for all of the “Top Level Domains” in existence today. Some examples of Top Level Domains, or TLDs as they’re known, are as follows:
A Superhero Receptionist Metaphor
I know there are a lot of words flying around with root servers, Name Servers, TLDs, and subdomains, so I’m going to try to frame these concepts into something a little easier to understand. Let’s try a receptionist metaphor and see how it goes. Oh, and maybe I’ll throw in some superheroes since that’s all the rage right now.
To summarize without superheroes:
1.Your DNS server asks your ISP’s DNS server for linuxacademy.com
Your Own Domain Name
If you’ve ever seen a commercial break for a large sporting event, you’re probably aware that purchasing your own domain name is quite simple. Choosing the domain registrar isn’t always as simple. Some registrars promise scantily-clad mediocre racecar drivers and others promise the cheapest price on the block. I strongly suggest choosing a registrar that also provides the hosting you wish to use. It will greatly simplify things to have everything in one place. So, if you are using AWS, use Route53 to purchase your Domain name. It might be a few bucks more, but you’ll be glad you did.
Exercise! Let’s do some WHOIS lookups!
2.Type “amazon.com” in the blank and click the magnifying class to search.
Registrant Contact Information:
Hostmaster, Amazon Legal Dept.
Amazon Technologies, Inc.
P.O. Box 8102
State / Province
Registrant Contact Information:
P.O. BOX 0823-03411
State / Province
Managing Your Shiny New Domain
Parts of a Record
Now that you own your own domain and you’ve played around in the settings a little, it’s time to hop back on the theory bus and explain what these record types are. These can be a little confusing when staring at a page full of records, so let’s get started!