I’m sure you’ve heard of DNS, but what is it? Why is it so important? And how does it work?
DNS stands for Domain Name System. The original specifications for DNS were published in November 1983. DNS was created as a way to simplify looking up which hosts (servers) have which IP address.
When you access any network or Internet resources using a domain name (such as apollonetworks.com) – your computer needs to translate this to a machine-readable IP address (such as 126.96.36.199) in order to connect to the host containing the resources you’re attempting to access.
Prior to DNS, a technician (or even a user) would need to memorize IP addresses of resources. This method is fine if you only have a handful of servers that you regularly connect to, but what happens when this becomes unmanageable? Back in the days of ARPANET (prior to the Internet as we know it today), the Stanford Research Institute maintained a text file known as HOSTS.TXT which had a mapping of hostnames to host numbers. It looked something like this:
HOST ACC, 2/54,SERVER,UNIX,PDP11 HOST ACCAT-TAC, 2/35,USER,TAC,C30,[NELC-TIP] HOST ADA-VAX, 0/52,SERVER,VMS,VAX,[ISI-VAXB,VAXB,AJPO] HOST AEROSPACE, 2/65,SERVER,UNIX,VAX,[A,AERO] HOST AFGL, 1/66,SERVER,NOS/BE,CDC-6600 HOST AFGL-TAC, 2/66,USER,TAC,C30 HOST AFSC-AD, 0/53,SERVER,NOS/BE,CDC-6600,[EGLIN] HOST AFSC-DEV, 2/53,SERVER,RSX11M,PDP11,[EGLIN-DEV] HOST AFSC-HQ, 0/67,SERVER,TOPS-20,PDP10,[HQAFSC]
Looks pretty complicated! Back in the ARPANET days host numbers looked like “2/54”, whereas an IP address today would look like “10.55.108.6”. This was essentially a text file that could be referenced to know how to access a particular device. For example, if we wanted to access the ACC server from the above excerpt, we would need to reference the file, and find that ACC can be found on network 2, host 54. Then we can access that host.
Managing a text file listing all of this information is hard to do, and a need to automate looking up host numbers (or IP addresses) from hostnames was identified. Thus DNS was born. Fast forward to today, and we use DNS more than we even realize.
When you accessed this page, your device recognized it was attempting to access apollonetworks.com, so it had to perform a DNS lookup. But how did it know where to look?
Every device is configured with DNS resolvers. These are servers that are either provided by your ISP, maintained internally as part of a corporate network, or are publicly maintained (such as Google Public DNS or Cloudflare DNS). Your device makes a request to these servers. If the server does not have a translation for that particular service cached, it begins the process of looking up the domain.
The DNS resolver will first look up the domain’s NS records (don’t worry, we’ll get to the different types of records in a bit) – these records tell the resolver which DNS server to communicate with. The resolver then establishes a connection to that DNS server and requests the record. If the server is operating correctly and has the record the resolver is requesting, it responds with the data it needs. The resolver then caches the data and passes it along to the device.
Let’s say you’re using Cloudflare’s public DNS servers as your resolvers, and you’re trying to access apollonetworks.com. Your computer will establish a connection to 188.8.131.52 requesting the A record (again, we’ll discuss the types of records in a bit) for apollonetworks.com. 184.108.40.206 doesn’t currently have it cached, so it looks up the NS records for apollonetworks.com and finds that 220.127.116.11 is the DNS server that it should use. 18.104.22.168 then establishes a connection to 22.214.171.124 and requests the A record for apollonetworks.com (the same way the computer requested it from 126.96.36.199). It then stores the data locally (to make subsequent requests faster), and delivers the response to the computer, so that the computer can connect as needed. The computer (in most cases) will locally cache the DNS reply so that it can continue to make connections without having to reach out to the DNS resolver each time.
I’ve mentioned DNS record types a few times, such as NS records and A records. There are a few different types, all of which do different things.
A records are Address records. They translate a hostname to an IP address, for example www.apollonetworks.com = 188.8.131.52.
NS records are Nameserver records. They delegate which DNS servers should be used for a particular domain.
MX records are Mail Exchanger records. They delegate which mail server is used for incoming mail for a domain (essentially telling someone else’s email system which server to send email messages to).
CNAME records are Canonical Name records. They are essentially aliases for other records. A common use case would be to create an A record for www.domain.com, and have a cname for domain.com pointing to www.domain.com.
I hope this brief overview of how DNS works was informative! If you have any questions about DNS (or anything else tech related) – please reach out! We’d be happy to answer any questions you may have.