How does DNS work? Learn how domain lookups, IP addresses, and caching connect you to websites, plus what encrypted DNS, VPNs, and leaks mean for privacy.
👉 Lock down your connection with NordVPN here: NordVPN
You’ll learn how DNS works, from domain name lookups and IP addresses to caching and common DNS errors. Understand what DNS reveals about your browsing and how encrypted DNS, VPNs, and DNS leaks affect your online privacy.
Chapters: 0:00 Intro 0:11 What does DNS actually do? 0:46 What happens during a DNS lookup? 1:37 Why do DNS changes take time? 2:16 Can DNS reveal which websites you visit? 3:19 How do encrypted DNS and VPNs work together? 4:16 Outro
Affiliate notice: Some links may earn a commission. Thanks for your support.
Key Takeaways
DNS translates hostnames into addressing information; it does not deliver webpages. Lookups concern names such as shop.example.com, not URL paths, passwords, or message contents.
An uncached lookup typically follows resolver → root → TLD → authoritative nameserver. Cached answers often skip much of this process. Cloudflare explains these roles.
TTL controls how long DNS answers can stay cached. Website address changes may remain invisible to some users until older answers expire; “propagation” is not a simultaneous global update.
DNS errors identify different problems: NXDOMAIN means the name does not exist; NODATA means the requested record is absent; SERVFAIL means resolution failed; a timeout means no usable response arrived in time.
DNS can reveal requested services, but not a complete browsing history. Background activity, speculative lookups, and caching complicate interpretation, as the IETF’s privacy guidance explains.
Encrypted DNS, HTTPS, and DNSSEC serve different purposes. Encrypted DNS protects lookups in transit to the resolver; HTTPS protects website communication; DNSSEC verifies signed DNS data without encrypting it.
Check three things when assessing DNS privacy: the resolver, encryption, and routing. A different resolver does not automatically prove a VPN leak, and enabling secure DNS does not guarantee requests use the VPN tunnel.
Changing DNS providers does not hide your public IP from websites. It can affect lookup speed, reliability, filtering, and privacy practices, not necessarily the route of your website traffic.
👉 Add a connection-level privacy layer with NordVPN to encrypt VPN-routed traffic and mask your public IP. It reduces network-level exposure, but does not provide complete anonymity or replace safer browsing habits.
DNS, short for Domain Name System, helps your device find the information it needs to connect to websites and other internet services. You enter a name such as www.example.com; DNS supplies addressing information your browser can use to locate the destination.
But how does DNS work behind the scenes, and what do those lookups reveal about your browsing? Understanding the process makes it easier to interpret DNS errors, understand why website changes take time, and distinguish encrypted DNS from HTTPS and VPN protection.
What Does DNS Actually Do?
DNS is a distributed lookup system. Its best-known job is translating domain names into IP addresses, the numerical addresses used to reach services over a network.
Think of it as a directory: you know the name, and your device needs addressing information. Unlike a single directory stored on one computer, DNS divides responsibility among many servers and organizations.
Some links may earn a commission. Thanks for your support.
Watch in the video playerOpen the dedicated player for this series.
The basic sequence is:
Request a name → find or retrieve its DNS information → use that information to connect.
DNS does not deliver the webpage itself. It helps your browser find where to connect; the browser then establishes a separate connection to retrieve the website.
DNS also does more than website address lookups. It can identify email servers, publish domain-verification information, and help applications discover services.
A Domain Name Is Only Part of a Web Address
Consider this URL:
https://shop.example.com/account?view=orders
Component
Purpose
https
Specifies how the browser intends to communicate
shop.example.com
The hostname that may need a DNS lookup
/account
A page or resource path handled by the website
view=orders
A query parameter handled by the website
An ordinary DNS lookup concerns shop.example.com, not the full URL. It does not include the page path, your password, or the contents of a message.
That distinction matters for privacy: DNS can reveal which names your device requests without revealing everything you do on those websites.
How Does DNS Work? A Step-by-Step Lookup
Suppose your browser needs an IP address for www.example.com. If no usable answer is already cached, the lookup typically involves several DNS roles.
1. Your Browser or Operating System Requests an Answer
Your browser needs addressing information before it can connect. Depending on its configuration, it may use the operating system’s DNS services or its own resolver.
Available caches are checked first. If a valid answer is already saved, the device may not need a fresh external lookup.
2. A Recursive Resolver Takes the Request
A recursive resolver finds DNS answers on your behalf. It may be supplied by your internet service provider, a public DNS service, or another network configuration.
Your home router may forward requests to an upstream resolver rather than perform the entire lookup itself.
If the recursive resolver already has a usable cached answer, it can return it immediately. Otherwise, it asks other DNS servers.
3. A Root Server Points Toward the Correct Top-Level Domain
For www.example.com, the resolver can ask a root nameserver where to find the servers responsible for .com.
The root server normally provides a referral. It does not fetch the website or return its page content.
4. A TLD Server Points Toward the Domain’s Nameservers
The resolver asks a top-level domain, or TLD, nameserver for the next step.
In this example, a .com server supplies delegation information pointing toward the authoritative nameservers for example.com.
5. An Authoritative Nameserver Supplies the DNS Record
An authoritative nameserver answers using the DNS data for the zone it serves.
The resolver requests the relevant record, such as an IPv4 or IPv6 address for www.example.com.
6. The Answer Returns, and the Browser Connects
The resolver returns the answer to your device and can cache it for later use. Your browser then uses the addressing information to establish its connection.
The simplified sequence looks like this:
Browser or operating system
↓
Recursive resolver
↓
Root nameserver → referral to .com servers
↓
.com nameserver → referral to example.com nameservers
↓
Authoritative nameserver → requested DNS answer
↓
Resolver returns the answer
↓
Browser connects to the destination
Most lookups do not repeat this entire journey. Cached answers, saved delegation information, and aliases can change the steps involved. Cloudflare’s DNS overview illustrates these roles in more detail.
Recursive and Iterative Lookups
These terms describe different parts of the process:
A recursive request asks a server to obtain an answer on the client’s behalf.
Iterative resolution involves following answers and referrals from one DNS server to another.
A typical consumer lookup combines both: your device asks a recursive resolver, and that resolver performs iterative work when necessary.
Common DNS Record Types
DNS stores information in resource records. The record type determines what kind of information is being requested.
Record type
What it provides
Common use
A
An IPv4 address
Locate a service over IPv4
AAAA
An IPv6 address
Locate a service over IPv6
CNAME
An alias pointing to another DNS name
Associate a hostname with another service name
MX
Mail-server destinations and preferences
Route incoming email
NS
Nameserver information
Identify authoritative servers and delegations
TXT
Text used by an application or protocol
Publish verification tokens or email policies
PTR
A pointer to another name
Support address-to-name lookups
SOA
Zone administration and timing information
Describe zone-management parameters
A CNAME is not a web redirect. It affects DNS resolution. An HTTP redirect is a response from a web server telling the browser to use another URL.
DNS Caching, TTL, and Propagation
Caching makes DNS faster and reduces repeated work. Instead of asking the same chain of servers every time, devices and resolvers can temporarily reuse previous answers.
What TTL Means
A record’s time to live, or TTL, tells caches how long they can normally retain it before refreshing.
For example:
A resolver receives an address record with a TTL of 300 seconds.
The website operator changes that address one minute later.
The resolver may continue returning the old answer for approximately four more minutes.
Another resolver might refresh at a different time. As a result, two people can temporarily receive different answers for the same name.
Why DNS Changes Are Not Instant
“DNS propagation” often describes a combination of authoritative-server updates and cached answers expiring. It is not a single update wave that reaches every internet user simultaneously.
Two details can also affect timing:
Negative caching: A response saying that a name or record does not exist can be cached. Creating the record does not immediately clear those saved responses.
Serve-stale behavior: Some resolvers can temporarily use expired data when fresh answers are unavailable.
A faster resolver may reduce lookup delays, but it does not directly increase the bandwidth available for every download.
What Common DNS Errors Mean
A DNS error does not necessarily mean your entire internet connection is down. Finding a destination and connecting to it are separate jobs.
Result or error
Meaning
NXDOMAIN
The queried name does not exist
NODATA
The name exists, but the requested record type is absent
SERVFAIL
The DNS server could not successfully complete the request
Timeout
No usable response arrived within the expected time
These distinctions help narrow down a problem. A nonexistent name is different from a resolver failure, and neither is identical to a website being unreachable after a successful lookup.
Network context matters, too. A workplace’s internal hostname may require its private DNS service. Switching to a public resolver may not resolve that name because the public service lacks the organization-specific information.
What DNS Reveals About Your Browsing
DNS requests are sensitive metadata. A hostname can reveal an interest, application, or service even when it does not reveal a particular page.
For example, requesting a specialized health-service domain may disclose something about a person’s interests without exposing any messages or account details.
Who Can See DNS Requests?
Visibility depends on encryption, routing, caching, and implementation.
The ability to observe a query is not the same as a policy of recording or retaining it. Both technical design and provider practices matter.
DNS Logs Are Not a Complete Browsing History
A DNS request does not necessarily prove someone deliberately visited a website:
Applications make background requests.
Embedded content can trigger lookups.
Browsers can perform speculative lookups.
Cached answers can allow connections without a fresh externally visible request.
As the IETF’s DNS privacy guidance explains, DNS data can be revealing, but it requires careful interpretation.
Encrypted DNS vs. HTTPS vs. DNSSEC vs. VPNs
These protections address different parts of the connection process. They are not interchangeable.
Encrypted DNS Protects the Lookup in Transit
Traditional DNS generally uses UDP or TCP on port 53. Neither transport, by itself, encrypts the query.
DoH, DoT, and DoQ protect DNS exchanges from being directly read by observers along the protected connection. However, the resolver receiving the query still needs to process it.
Encrypted DNS therefore changes who can observe the lookup; it does not remove the need to trust a resolver. It also does not automatically hide destination IP addresses, connection timing, or other traffic clues.
Some applications can fall back to unencrypted resolution when encrypted DNS fails, while stricter modes may show an error instead. Mozilla’s documentation on DNS over HTTPS explains how protection levels can affect that behavior.
HTTPS Protects Website Communication
HTTPS protects the connection between your browser and the website. It does not automatically protect a separate traditional DNS request used to locate that site.
Properly used HTTPS still protects website communication on public Wi-Fi. Unencrypted DNS and other connection metadata remain separate privacy considerations.
DNSSEC Checks Authenticity, Not Privacy
DNSSEC allows validating resolvers to check signed DNS data against a chain of trust. It helps detect forged or altered answers for appropriately signed zones.
It does not encrypt the lookup, and it does not certify that a website is honest or free of malware. ICANN’s DNSSEC explanation describes this distinction.
A VPN Protects Traffic Routed Through Its Tunnel
A VPN creates an encrypted tunnel between your device and a VPN endpoint. When DNS and website traffic travel through that tunnel, it reduces what the local network or ISP can directly observe about those exchanges.
For website connections routed through the VPN, the destination generally sees the VPN server’s public IP address instead of your own.
That is an additional privacy layer, not anonymity. The VPN provider becomes another party you must trust, and logging into a website can still identify you to that website.
DNS Leaks: When Requests Take an Unexpected Route
A DNS leak occurs when DNS requests escape the routing or privacy boundary you expected.
For example, website traffic might use a VPN while DNS requests travel directly to an ISP resolver outside the tunnel.
DNS and VPN behavior can diverge because:
A browser uses a different resolver from the operating system.
Split-tunneling rules route traffic differently.
A connection failure triggers fallback behavior.
Browser, VPN, or managed-network policies interact.
A Different Resolver Does Not Automatically Prove a Leak
Resolver identity and network path are separate questions. A browser may contact a third-party encrypted resolver through the VPN tunnel.
Likewise, encrypted DNS outside the tunnel differs from plaintext DNS outside it. Both may violate your intended routing policy, but encrypted DNS can still protect query contents from the local network.
When reviewing privacy settings, consider three separate questions:
Which resolver receives the request?
Is the DNS exchange encrypted?
Does it travel through the intended VPN route?
An enabled “secure DNS” switch does not answer all three.
What Changing Your DNS Provider Can, and Cannot, Do
Choosing a different resolver can affect lookup reliability, response time, filtering, and privacy practices.
A filtering DNS service may block known phishing domains, malware destinations, or selected advertising and tracking hosts. But DNS filtering works at the name level, not the individual page level.
That creates limits:
It cannot reliably separate advertising from essential content on the same hostname.
It can produce false positives.
It does not inspect an entire encrypted webpage.
Successfully resolving a domain does not prove the destination is safe.
Changing DNS providers also does not, by itself, hide your public IP address from websites. It changes how names are resolved, not necessarily how the subsequent website connection is routed.
Add a Connection-Level Privacy Layer
Understanding DNS helps you separate website lookups from connection protection. Encrypted DNS protects the exchange with your resolver; HTTPS protects website communication; a VPN adds protection for traffic routed through its tunnel.
For everyday browsing, a VPN can help reduce local-network exposure and show websites a VPN server’s IP address instead of your own. It remains an added layer, not a replacement for HTTPS, safer browsing habits, or careful privacy settings.
👉 Try NordVPN to encrypt VPN-routed traffic and mask your public IP on your phone and computer.
Affiliate notice: Some links may earn a commission. Thanks for your support.
Next
FAQ
Quick answers to the questions people usually ask about this topic.
Does DNS run every time I open a webpage?
Not necessarily. Your browser, operating system, or recursive resolver may already have a usable cached answer, so a full lookup is often unnecessary. Opening another page on the same website may also reuse an existing connection. However, a page that loads images, scripts, or other content from additional hostnames can trigger more DNS lookups.
When does flushing the DNS cache help?
Flushing your device’s DNS cache can help when it holds an outdated address or a cached response saying a name does not exist. It forces that local cache to request fresh information. It does not clear your recursive resolver’s cache, repair incorrect authoritative records, or fix a website outage. Browsers may also maintain separate DNS caches.
Can I bypass DNS by typing a website’s IP address?
Sometimes, but it is not a reliable workaround. Many websites share an IP address and rely on the requested hostname to select the correct site. HTTPS certificates also usually identify domain names rather than the server’s IP address, so entering an IP directly can cause a certificate error or load the wrong site. Do not bypass certificate warnings to force a connection.
Does incognito mode hide DNS requests from my ISP?
No. Private or incognito browsing primarily limits what the browser saves locally; it does not automatically encrypt DNS requests or route traffic through a VPN. What your ISP can observe still depends on your DNS encryption, traffic routing, and other connection settings. Even with encrypted DNS, destination IP addresses and traffic patterns can remain visible.
Why does a domain work on my phone but not on my computer?
The devices may use different cached answers, DNS resolvers, browser settings, or network routes. For example, a phone on mobile data may receive a different answer from a computer using home Wi-Fi. Compare them on the same network, check browser-level secure DNS and VPN settings, and look at the exact error. For workplace-only names, make sure the required private network or VPN is connected.
Can websites keep working during a DNS outage?
Some can, temporarily. An established connection may continue working without another lookup, and cached DNS answers may still let your device reconnect. A hostname that needs a fresh lookup can fail if its resolver or authoritative servers are unavailable. This is why a DNS outage may affect some websites or devices before others.
What can I use to reduce network exposure beyond encrypted DNS on public Wi-Fi?
A VPN can add an encrypted tunnel for traffic routed through it, reducing what the Wi-Fi operator can directly observe and showing websites the VPN server’s public IP instead of your own. As a practical next step, consider NordVPN to apply that connection-level protection on your phone and computer. Check that DNS follows your intended VPN route, keep HTTPS enabled, and remember that a VPN shifts trust to its provider rather than making you anonymous.
Affiliate link — I may earn a commission at no additional cost to you.
Jay's Recommendation
Turn privacy knowledge into everyday protection
The series explains online privacy. NordVPN helps you put it into practice with encrypted connections, IP masking, and apps for everyday devices. Reduce network-level exposure without building your own setup. It’s an added privacy layer, not complete anonymity or a replacement for safer browsing habits.
🔒Encrypted connectionsHelp shield VPN-routed traffic from observers on shared Wi-Fi.
👁Less ISP visibilityLimit what your provider can see about browsing carried through the VPN.
🎭Masked public IPShow websites the VPN server’s address instead of your own.
📱Privacy across devicesPut connection-level protection to work on your phone and computer.