If your email provider has changed or your website has been moved to a new hosting company, you may have heard the terms “DNS” or “DNS records” thrown around. But what is DNS, exactly? DNS stands for Domain Name System, and it’s at the core of making web browsing possible.
In this blog post, we’ll break down how the DNS system works and explain the most common terminology.
How does the DNS system work?
Us humans like to deal with domain names because they’re easy to type in and remember. But behind the scenes, computers use IP addresses to navigate the internet.
Simply put, the Domain Name System (DNS) functions like a phone book or a building directory for the internet. It uses DNS records to direct traffic to correct places and allows us to use human-friendly domain names instead of IP addresses.
So, when you type in a domain (like mukava-agency.com, for example) into your browser, behind the scenes DNS will determine its IP address is 162.243.11.122 allowing you to fetch the website.
To dive a little deeper, let’s first break down the terminology associated with DNS:
- Authoritative Name Server: This is where the domain’s owner adds all the DNS records for their domain. It is the ultimate source of information about that domain. Typically your Authoritative Name Server is provided by your domain registrar to keep them under the same roof, so to speak. But as DNS records get more complicated, some more basic name servers might not support the latest types. In that case you might need to use a more advanced name servers from a service like Cloudflare, for example.
- Name Resolution: When your device needs to look up an IP address for a domain name, it makes a DNS query. This query usually goes to a recursive DNS server provided by your ISP (Internet Service Provider). If this server doesn’t know the IP address, it will ask other DNS servers in a process that continues until the authoritative name server for the domain is reached. The authoritative server knows the IP address for the domain and responds back through the chain to your device.
- Caching: To speed up web browsing and reduce the DNS queries, DNS records are often cached at various points in the DNS lookup chain, including your own computer, your router, and your ISP’s DNS servers. Caching can dramatically speed up DNS lookup times for frequently accessed sites. On the flip side, if you’ve ever moved a website from one host to another, you might remember that there’s often a delay before you start seeing the new website. This is often because somewhere in the chain between your computer and the domain’s name servers, a DNS server is caching the old address.
- TTL: TTL, or Time To Live, is a value associated with DNS records that tells recursive DNS servers how long they should cache the record before querying the authoritative name server again for updated information. The TTL is measured in seconds; common values might range from a minute (60 seconds) to 48 hours (172800 seconds). A shorter TTL means updates will propagate more quickly but at the cost of increased DNS query traffic, potentially overloading DNS servers.
- DNS Record: These are the different types of records that tell the world the address of the server your website can be found at, where incoming email should be routed, and other information about your domain. Let’s look at the types of DNS records in the next section.
Most common DNS record types
There are many different types of DNS records. For the purposes of this introductory post, we’ll just cover the most typical ones.
- A/AAAA (Address) Records: The A record is the most fundamental type of DNS records and maps a domain name to its corresponding IP address. As explained above, the A record for mukava-agency.com points 162.243.11.122. This record is crucial for directing traffic to the correct server.
- CNAME (Canonical Name) Record: The CNAME record allows you to alias one domain name to another. This is useful for mapping multiple domain names to a single IP address or managing subdomains. For instance, www.mukava-agency.com points to mukava-agency.com so that both versions of the domain name can be used to access the website.
- MX (Mail Exchange) Record: MX records are crucial for routing email communications properly because it specifies which the mail servers responsible for receiving email on behalf of a domain. For redundancy, many email service providers have multiple servers handling the incoming email, and you can specify them in the order of priority. If Google Workspace is your email service provider, your domain’s MX records might look something like this, where the first number tells the priority, and the latter part is the address of the server:
5:gmr-smtp-in.l.google.com
10:alt1.gmr-smtp-in.l.google.com
20:alt2.gmr-smtp-in.l.google.com
30:alt3.gmr-smtp-in.l.google.com
40:alt4.gmr-smtp-in.l.google.com - TXT (Text) Record: TXT records allow domain administrators to insert arbitrary text into a DNS record. These are often used for various verification methods, including email spam prevention frameworks like SPF (Sender Policy Framework), domain ownership verification, and implementing DKIM (DomainKeys Identified Mail). You may have needed to do this for Google Search Console or emailing service verification.
- NS (Name Server) Record: NS records identify the authoritative DNS servers responsible for a domain, and where you actually enter and maintain your DNS records.
Due to their nature, DNS records are public. You can use a tool like What’s My DNS to look at the DNS record values of any domain.
How are DNS changes made?
The DNS system has many layers and parts. To explain this, it might be useful to approach it from the perspective of what happens when we need to make a change to a DNS record. Let’s say a website moves to a new hosting company, and the domain administrator needs to point the root domain’s A record to point to the new host.
Making Changes at the Authoritative Name Server
- Initiation of Changes: In our example, the process begins when a domain administrator updates the A record for their domain. This would involve changing the IP address associated with the domain. These changes are made on the authoritative name server for the domain.
Propagation Through the DNS Hierarchy
- Propagation to Recursive Resolvers: Once the A record is changed on the authoritative name server, it doesn’t automatically update across the entire internet. Instead, the new information is retrieved by recursive DNS servers (these are often run by ISPs or third-party DNS services) when they next query the authoritative name server for the domain. These recursive DNS servers cache DNS records for a period determined by the TTL value.
- Refresh Based on TTL: As the TTL expires on recursive DNS servers around the world, they will query the authoritative name server for the domain again, receiving the updated record. This gradual refreshing based on TTL expiration is why DNS propagation can take time and isn’t instantaneous.
Global Propagation
- Global DNS Network: The DNS system is a distributed, global network. This means that the time it takes for changes to propagate worldwide depends on the location of the querying DNS servers and their cached data expiry. Changes will propagate faster to locations where DNS queries for the domain are more frequent, prompting more immediate refreshes of cached data.
- End-User Impact: For the end-user, this means that after a DNS record change is made, there may be a period during which different users might be directed to old or new records based on whether their DNS resolver has updated its cache.
DNS record change propagation is a decentralized process influenced by the authoritative name server updates and the TTL settings of DNS records. The process used to take a long time (up to 96 hours), but these days changes can propagate in a matter of minutes. You can use a tool such as What’s My DNS to monitor the propagation process.
Conclusion
DNS is an invisible and critical component of the internet infrastructure. It does things in the background that enable the user-friendly web browsing experience we’re accustomed to. An unsung hero of the internet, in a way. If you have questions about DNS records or need help making changes to yours, let us know!