DNS Basics

This post is part of a new series designed to help developers who are just starting out understand some basics and how they relate to WordPress. This first post is about DNS, including what it is and why you need to understand it.

DNS stands for Domain Name System, so let’s get that out of the way first. Every time you use the internet you’re interacting with it, whether you realize it or not. That’s because DNS is a protocol within a set of standards for how computers exchange information with one another (TCP/IP protocol suite). The graphic above depicts a common DNS interaction between user, computer, server, ISP, and more. An ISP is just an internet service provider (think cable company for example) so that’s easy to wrap your head around.

The basic goal of the DNS system is to take user-friendly domain names like test.com and route them to the appropriate IP address since servers don’t speak domain lingo. For example, the DNS system might translate test.com to an IP address of 70.70.700.70 behind the scenes when you’ve typed it into your browser. This task is handled by something called a domain name server, DNS server, or name server. All three tend to be thrown around and mean the same thing. We’ll use the terminology DNS server for the purposes of this article since it’s the most descriptive of the three. Basically the DNS server has a database of domains and which IP address each maps to and just sends the request (user) to the proper location based on the records it has at the time of the request. The proper name for this process is DNS name resolution, since it’s resolving the domain to the proper IP address.

You can always bypass DNS by entering a site’s IP address directly into the browser instead of the domain. This is a good way to test for things to see if the issue is related to your domain being pointed incorrectly for example. Keep in mind IP addresses can change over time so that’s another reason domains work better. Google.com might be powered by a certain IP address one day and a different one the next, so it’s easier to just navigate to Google.com rather than trying to keep up with the current IP address they have assigned to their server. Also it’s important to understand that some sites (like Google) associate more than one IP address with their domain which is just one more reason the DNS system is so helpful.

So how does your laptop at home connected to internet via your cable provider (ISP) know which IP address to resolve a domain to? There’s obviously a DNS server handling the DNS name resolution process, but who is doing it? In this case since your ISP is your cable company, it’s them! For example, if you have your laptop connected to a modem from your cable company, they have likely sent some network configuration information to the modem that is passed to your laptop. Part of this information is likely a dictation of which DNS servers the laptop should use when translating domains to IP addresses.

Stay tuned for future posts on things like HTTP vs. HTTPS, rsync, FTP vs SFTP, SSH, and more.

0 Comments