Blog / Tutorials
Understanding DNS: What Happens When You Type a URL
, 9 min read
You type arnikohackclub.com into your browser and press enter. Less than a second later, the website appears. In that fraction of a second, your computer performed one of the most elegant processes in computing — DNS resolution. Understanding it changes how you think about the internet.
The Problem DNS Solves
Computers communicate using IP addresses — numbers like 104.21.32.1. Humans communicate using names like arnikohackclub.com. DNS (Domain Name System) bridges this gap. It is essentially a massive distributed phone book that translates names into numbers.
Without DNS, you would have to memorize the IP address of every website you visit. DNS makes the internet usable for humans.
The Resolution Process Step by Step
Step 1: Browser cache. Your browser checks if it has recently looked up this domain. If you visited arnikohackclub.com five minutes ago, the browser already knows the IP address and skips the entire DNS process. This cache typically lasts a few minutes to a few hours.
Step 2: Operating system cache. If the browser does not have it cached, it asks the operating system. Your OS maintains its own DNS cache. On Windows, you can see it by running ipconfig /displaydns in the command prompt.
Step 3: Router cache. If the OS does not know, the request goes to your router, which also caches DNS results for all devices on your network.
Step 4: ISP recursive resolver. If nobody in your local chain has the answer, the request goes to your ISP DNS server (or whatever DNS server you have configured — more on that later). This server is called a recursive resolver because it will recursively query other servers until it finds the answer.
Step 5: Root name servers. The recursive resolver asks a root name server. There are 13 root server clusters worldwide (identified by letters A through M), distributed across hundreds of physical servers. The root server does not know the IP for arnikohackclub.com, but it knows where to find information about .com domains.
Step 6: TLD name servers. The root server points the resolver to the .com TLD (Top-Level Domain) name servers. These servers know which authoritative name server is responsible for arnikohackclub.com.
Step 7: Authoritative name server. The TLD server points the resolver to the authoritative name server for arnikohackclub.com. This is the server that actually has the DNS records for the domain. It responds with the IP address.
Step 8: Response. The recursive resolver caches the result and sends it back to your computer. Your OS caches it, your browser caches it, and finally your browser connects to the IP address to load the website.
DNS Record Types
A record: Maps a domain name to an IPv4 address. The most basic DNS record.
AAAA record: Maps a domain name to an IPv6 address.
CNAME record: Maps a domain name to another domain name (an alias). For example, www.arnikohackclub.com might be a CNAME pointing to arnikohackclub.com.
MX record: Specifies the mail server responsible for receiving email for a domain. When someone sends email to you@arnikohackclub.com, the sender mail server looks up the MX record to know where to deliver it.
TXT record: Stores text data. Used for email authentication (SPF, DKIM, DMARC), domain verification, and other purposes.
NS record: Specifies the authoritative name servers for a domain.
Why Developers Need to Understand DNS
When you deploy a website, you need to configure DNS records to point your domain to your server. When you set up email, you need MX records. When you verify domain ownership for services like Google Search Console, you add TXT records.
DNS misconfigurations are a common source of "my site is not loading" problems. Understanding DNS lets you diagnose these issues instead of blindly waiting for things to work.
Changing Your DNS Server
You do not have to use your ISP DNS server. Cloudflare DNS (1.1.1.1) and Google DNS (8.8.8.8) are often faster and more reliable than ISP DNS. You can change your DNS server in your computer network settings or on your router to affect all devices.
In Nepal, switching to Cloudflare or Google DNS can sometimes improve browsing speed because ISP DNS servers may be slower or less reliably maintained.
DNS Security
DNS was designed without security in mind. DNS requests are traditionally unencrypted, meaning your ISP can see every domain you look up. DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) encrypt DNS queries. Modern browsers support DoH — check your browser settings to enable it.
DNS cache poisoning is an attack where a malicious actor corrupts DNS cache entries to redirect users to fake websites. DNSSEC (DNS Security Extensions) adds digital signatures to DNS records to prevent this, though adoption is still incomplete.
Try It Yourself
Open your terminal and run nslookup arnikohackclub.com to see the DNS resolution. Run dig arnikohackclub.com for more detailed output including TTL (Time To Live — how long the result should be cached). These tools demystify DNS and make the invisible visible.