DNS, short for domain name system, can be really hard to wrap your brain around, but is an integral part of the way websites work. If you’ve ever been confused about DNS, DNS records, or DNS management, I hope to clear up any confusion you may have about how it works. Let’s break down what DNS is, and how it serves a website.
DNS – Domain Name System – What it does
DNS, short for domain name system, is a variety of processes related to pointing a web request to the right place to find an end product. This sounds nebulous, I know, so let me give a couple of examples:
- Your domain email is hosted on Office 365 – Microsoft’s servers – you use DNS to connect the “nice name”, also known as the human-readable URL ([email protected]), to Microsoft’s servers so you can get your email
- Your website is hosted on Dreamhost’s servers – you use DNS to connect the “nice name” – the easily remembered word or phrase you came up with (yourwebsite.com) – to Dreamhost’s servers so when someone types in your URL, your website comes up
DNS is just a method from getting from point A to point B, and managing those methods, so all of the hard work is done seamlessly in the back end. Just about any web host or domain registrar will allow you to manage your DNS; even firewall companies like CloudFlare can manage your DNS records for you.
No one would remember to type in 2001:0db8:85a3:0000:0000:8a2e:0370:7334 to get to Google’s front page, so DNS makes it possible for us to use Google.com instead, and have the computer do the work of remembering the IP address of the host!
Hold up – What’s a DNS record now?
You have your domain in one hand, and where everything is physically located in the other. We know that DNS is the process of connecting the two together, but we need DNS records in order to do that. A DNS record is the bit of information that we input into the DNS management system that tells the web request where that thing is when I make the request on your domain. A DNS record can be just about anything:
- NS/Nameserver Record – This tells the web request who is hosting your final DNS if it is not the same as the place that holds the domain. For example, buying a domain at Namecheap.com, and then hosting at Dreamhost.com, it may make more sense to manage the DNS on Dreamhost.com, so you would change the nameservers to point to Dreamhost – NS1.dreamhost.com, NS2.dreamhost.com, NS3.dreamhost.com. A nameserver is the answer to the question “who is managing all of your DNS records?”
- A Record – tells the web request, when hitting the parent domain, where the server is that holds the files for that domain. An example would be typing hasOptimization.com into your browser’s URL bar, and coming to the front page of our website – an A record tells the computer where the files associated with that website are located. An A record is the answer to the question “OK, where is the website, if one exists?” This record will look like a standard IPv4 address, like 192.168.1.1
- AAAA Record – does the same thing as an A record, but it utilizes an IPv6 address instead of an IPv4 address. This record will look similar to: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- MX Record – mail exchanger record, tells the web request where the mail exchanger (email) is located. This can look like: mx.domain.com or in Google’s case, aspmx.l.google.com
- CNAME Record – this particular record can be used to point a subdomain to another server, which allows us to use this record as an “alias” for another website. This sounds complex, but it’s simple: it’s a way we can have google.hasoptimization.com serve up contents from google.com
- TXT Record – this sort of record is just a placeholder where you can put things that can, for example, prove that you own a domain. If you told me you owned yahoo.com, I could ask you to place a TXT record that said “hi Aimee!” on yahoo.com, and I could check that it’s there to verify that you have control of that domain. Other records placed here are SPF records, machine-verifiable verification records, and more.
- SRV Record – “service” records specifically pertain to services like VoIP, instant messaging, or other services, and are intended for those services to easily connect from your domain to the service. SRV records often have a host and port number attached to them.
- …And many more. There are lots of different types of DNS records, all with their unique purposes, but the above record types are the most common and most important to understand.
DNS and time-based needs
Now that you know what DNS is, you should also know that DNS records are not kept in one centralized database just waiting for anyone to make a web request. From the moment you type into your browser the URL of a website, your computer is instantly requesting through a chain of servers and routes to get the end product – a website. There are multiple data centers around the world that receive updates to the records they need to send out to your web request constantly. That means that when you make a change in your DNS, it is never instantly implemented. In fact, DNS can take 24-48 hours to fully complete a process known as “propagation” which is exactly how it sounds – information being shared and transferred around the world to get the most up-to-date things about your website. When a website is “fully propagated”, that means all of the data centers around the world are consistent and have the same information – they are up-to-date.
We often think of the internet as an instantaneous thing, but data does take time to travel, and can take a whole day to get to the other side of the world!
It’s important to note that if you need to make changes to your DNS, you will need to wait each time you make a change. For example, you change your A record once – you need to wait 24 hours for full propagation of that. However, you noticed right after you changed it, that you made a typo, so now you’ve gone in and changed it a second time. The clock resets on your propagation – the first change (with the typo) will hit first, followed by the second change. There is no way to make propagation go any faster. Some servers instantly change (usually closer to your host will get them quicker) whereas others take some time. If you keep making multiple changes out of frustration for the speed of propagation, it’s possible your website will be all over the place for the next few days when you’re done.
Having an understanding of the process of what DNS is and how it affects you can help you, especially as a business owner, be more understanding and in-the-know when it comes to your website. It also prepares you for the occasional nationwide DNS outage, so if something like that occurs, then you know your website team isn’t fibbing when they tell you how long it can take for some items to come back online. Knowing about DNS can also help you make your own changes if you’re a DIYer. Confused about something? Let me know in the comments and I’ll do my best to clarify!