Skip to content
BeoHosting
BeoHosting
Technical

What Is DNS and How It Works - Explained

BeoHosting Team··8 min read read
What Is DNS and How It Works - Explained

DNS (Domain Name System) is one of the most important systems on the internet. Understanding DNS is key for domain registration, but it's also one of the least understood. Every time you enter a site address in a browser, the DNS system works in the background to connect you to the right server. In this article we'll simply explain how DNS works, what happens when you enter a site address, and how to fix the most common DNS issues.

DNS - the internet's phone book

Think of DNS as a giant phone book of the internet. When you register a domain, you're really adding a new entry in this phone book. Computers communicate using IP addresses - strings of numbers like 192.168.1.1 or 2001:db8::1. However, it's much easier for people to remember names like "beohosting.com" than long strings of numbers. The DNS system converts domain names into IP addresses computers understand - this process is called DNS resolution.

Without DNS, you would have to remember the IP address of every site you want to visit. Instead of typing "google.com", you would have to type "142.250.185.14". DNS automates this process and makes the internet usable for ordinary users. Every time you open a site, send an email, or use any online service, DNS works in the background.

How DNS resolution works

When you enter a site address in a browser, a chain of queries called DNS resolution is triggered. This process goes through several steps and usually takes only a few milliseconds, but involves multiple servers cooperating to find the right IP address.

The first step is checking the local cache. Your computer stores DNS records it has already resolved in a local cache. If you recently visited the same site, your computer already knows the IP address and doesn't have to ask anyone. This drastically speeds up loading of sites you visit often. The DNS cache is kept for a certain time defined by the TTL (Time To Live) value.

If the address isn't in the local cache, your computer sends a query to a recursive DNS resolver. This is usually your internet provider's (ISP) DNS server or a public DNS server like Google's (8.8.8.8) or Cloudflare's (1.1.1.1). The recursive resolver is like a librarian who knows where to look for information - they'll do all the work for you.

The recursive resolver first asks the root DNS servers. There are 13 groups of root servers (labeled A through M) distributed worldwide. The root server doesn't know the exact IP address of your site, but it knows which server is responsible for .com, .net, .org, or another top-level domain (TLD). The root server directs the resolver to the right TLD server.

The TLD server (for example, the server for .com domains) also doesn't know the exact IP address, but it knows which DNS server is authoritative for the specific domain. It directs the resolver to the authoritative DNS server set during domain registration. The authoritative DNS server finally returns the IP address of the requested domain.

This whole process happens in less than 100 milliseconds in most cases. The recursive resolver caches the answer so the next time someone asks for the same domain, the response is instant without having to go through the whole chain again.

Types of DNS records

DNS doesn't only store IP addresses - there are multiple types of DNS records serving different purposes. The A record (Address Record) maps a domain to the IPv4 address of your hosting server. The AAAA record does the same for IPv6 addresses. The CNAME record (Canonical Name) creates an alias - for example, www.yourdomain.com can be a CNAME pointing to yourdomain.com.

The MX record (Mail Exchange) tells where email for your domain should be delivered. The TXT record contains text information and is used for SPF, DKIM, and DMARC records that help with email authentication. The NS record (Name Server) specifies which DNS servers are authoritative for your domain. Each of these records has its role in how your site and email work.

DNS propagation - why changes are not instant

When you change your domain's DNS records - for example, when you move the site to a new host - changes won't be visible instantly for all users worldwide. This process is called DNS propagation and can take from a few minutes to 48 hours, though in practice it's usually completed in 2-4 hours.

The reason for this delay is caching. Every DNS server in the chain stores a copy of the record for a certain time (TTL). Until the cache expires, the server will use old information. Different ISPs have different caching policies, so some users will see changes faster than others. That's why you may see the new site while your colleague still sees the old one.

To speed up propagation, reduce the TTL value to 300 seconds (5 minutes) at least 24 hours before a planned change. That way, when you make a change, the old cache will expire in just 5 minutes instead of hours or days. After propagation, you can return TTL to a normal value of 3600 seconds (1 hour) or more to reduce load on DNS servers.

TTL - Time To Live

TTL (Time To Live) is a value in seconds that tells DNS servers how long to keep a DNS record in cache before re-asking the authoritative server for an updated version. A typical TTL value is 3600 seconds (1 hour), but it can be from 60 seconds to 86400 seconds (24 hours) or more.

A low TTL (300-600 seconds) is useful when you plan frequent changes or want fast propagation. A high TTL (3600-86400 seconds) reduces load on DNS servers and can slightly speed up site loading because the resolver doesn't need to check for updates as often. For most sites, a TTL of 3600 seconds is a good balance between flexibility and performance.

Public DNS servers

Most users use their internet provider's DNS server by default. However, public DNS servers can be faster, safer, and more reliable. Google Public DNS (8.8.8.8 and 8.8.4.4) is one of the most popular - it's fast and reliable. Cloudflare DNS (1.1.1.1 and 1.0.0.1) focuses on privacy and speed, and is often the fastest public DNS server.

Quad9 DNS (9.9.9.9) automatically blocks known malicious domains and provides an extra layer of security. OpenDNS (208.67.222.222) offers parental controls and content filtering. Changing the DNS server on your computer or router is simple and can significantly improve your internet experience.

Most common DNS problems and solutions

The most common DNS problem is "DNS server not responding" - this usually means your ISP's DNS server has an issue. The solution is to change the DNS to a public server like 8.8.8.8 or 1.1.1.1. Another common issue is a DNS cache holding old information - the solution is to flush the DNS cache with the command "ipconfig /flushdns" on Windows or "sudo dscacheutil -flushcache" on macOS.

If you recently changed hosting and your site doesn't load, it's probably DNS propagation. Verify your DNS records are correctly set using tools like nslookup, dig, or online tools like WhatsMyDNS.net or MXToolbox. These tools show you which DNS records are visible from different locations worldwide.

The problem of email not arriving is often related to MX records. Check whether your MX records are correctly set and point to the right mail server. Also check SPF, DKIM, and DMARC records because incorrect configuration of these records can lead to your emails ending up in the spam folder.

Conclusion

DNS is the foundation of how the internet works and understanding how it works helps you better manage your site and domain. Remember DNS is like a phone book that translates domain names into IP addresses, change propagation can take up to 48 hours, and you can speed up changes by reducing the TTL value. If you have a DNS problem, the BeoHosting support team can help you fix it quickly.

BeoHosting Team

10+ years of experience — Web hosting and infrastructure specialists

  • Web Hosting
  • WordPress Hosting
  • VPS
  • Dedicated Serveri
  • Domeni
  • SSL
  • cPanel
  • LiteSpeed
  • Linux administracija
  • DNS

Last updated: