DNS & Connectivity

What Is DNS and How Does It Work?

A directory clerk follows a hierarchy to find a network destination, illustrating how DNS resolves names.

What is DNS and how does it work? DNS, the Domain Name System, finds the network records behind names such as loqmi.com. When an app needs a name, your device asks a recursive resolver. If that resolver's cache has no current answer, it follows referrals through the DNS hierarchy to an authoritative nameserver. The answer gives the app an address or another record, so it can get on with connecting.

What DNS does: names, addresses, and records

DNS is a distributed directory, not the website itself. In www.example.com, www is a host label, example is the registered domain, and com is the top-level domain (TLD). Different organizations manage different parts of this hierarchy.

A lookup asks for a record type. Websites usually need an A record for IPv4 or an AAAA record for IPv6. DNS also helps email systems find mail servers, and it lets services publish aliases or verification data. Think of a receptionist who routes several kinds of calls, not one who only hands out a single address.

RecordWhat it containsCommon purpose
AIPv4 addressFind an IPv4 destination for a hostname.
AAAAIPv6 addressFind an IPv6 destination for a hostname.
CNAMEAnother hostnameMake one name an alias of another; it is not itself an IP address.
MXMail server name and priorityHelp senders find a domain's mail service.
NSNameserver namesIdentify the servers authoritative for a DNS zone.
TXTText dataPublish verification or email policy information.

What is DNS and how does it work?

Your device's small stub resolver sends the question to a recursive resolver. That resolver is often run by your ISP, your router, your workplace, a VPN, or a public DNS service. It finds the answer, or an error, and returns it.

A resolver follows referrals to a domain's authoritative server and returns an answer. DNS lookup turns a name into records.
When its cache has no answer, a recursive resolver follows root and TLD referrals to the authoritative nameserver, then returns the result.
  1. Check local answers. The app, browser, operating system, or hosts file may already hold a result, so no public lookup is needed.
  2. Ask the recursive resolver. The device sends the hostname and record type. A cached answer can finish the lookup right here.
  3. Ask the root, if needed. A root server points the resolver to the nameservers for the relevant TLD, such as .com. It does not store every website address.
  4. Ask the TLD. The .com server points the resolver to the authoritative nameservers for example.com.
  5. Ask an authoritative nameserver. It publishes the zone's records and returns the requested record, alias, delegation, or negative answer.
  6. Return and connect. The resolver caches an eligible answer and sends it back. The browser or app then uses the address to connect.

This is a cold-cache example. A resolver may already know part of the route and skip a few stops. Think of the root as a map that points to the next map, not a giant directory of every destination.

Two server roles, two jobs: the recursive resolver finds answers for clients, while an authoritative nameserver publishes the records for a zone. “DNS server” is a broad label that can mean either one.

DNS is separate from your IP and network settings

DNS finds records. It does not give your device an address. Your router or network usually uses DHCP (Dynamic Host Configuration Protocol) to hand devices a private IP, a gateway, and often the resolver address.

DNS matches names with records while DHCP supplies a device with its local address and gateway settings.
DNS looks up records for names; DHCP usually assigns a device its private IP address and gateway.

NAT (Network Address Translation) lets devices with private addresses share one public connection. Private IPv4 ranges are reserved by RFC 1918. Regional internet registries (RIRs) coordinate internet number resources, and your ISP assigns or routes the public address for your connection. These jobs are separate from DNS, so changing DNS does not change your IP. Check your public address with Loqmi's IP tool, or read how to find a website's IP.

Caching, TTL, and common DNS errors

A record's TTL (time to live) tells caches how long they may reuse it. Think of it as a sticky note saying when to check again. Caches can sit in a browser, a device, a router, or a recursive resolver. Negative answers can be cached too, so clearing one device's cache does not erase answers elsewhere. See DNS TTL explained.

Check the symptom before you change settings. One failing hostname is different from every site failing, and “DNS propagation” is not a single switch (the internet has not installed that button yet).

SymptomWhat it can meanUseful next check
NXDOMAINThe resolver reports that the queried name does not exist in the DNS view it checked.Check the hostname spelling and whether the owner published the record. Try another network if split DNS or filtering may apply.
SERVFAILThe resolver could not complete the lookup; the cause may be upstream, a delegation issue, or DNSSEC validation.Try a second resolver or query with dig or nslookup; note which server answered.
One site fails, others workA missing or incorrect record, stale answer, or site-side issue is more likely than a full connection outage.Test the exact hostname and another network before changing all device DNS settings.
An old destination remains after an editA cache may still be within its TTL, or the record was changed at a provider that is not authoritative.Check the domain's authoritative nameservers and record there; wait for cached answers to expire.

Use dig example.com on many macOS and Linux systems, or nslookup example.com on Windows. They show the answer and often the resolver, though browser encrypted DNS may use another path.

How to check DNS settings on each device

Paths can vary by device maker, Linux distribution, VPN, or work profile. Write down the current values before you edit anything, so you can restore them.

Windows 11

Open Settings > Network & internet, then choose Wi-Fi > Manage known networks and the network, or Ethernet and the connected network. Beside IP assignment, select Edit. Automatic (DHCP) takes settings from the network. Manual shows the DNS fields. ipconfig /all lists DNS servers. See Microsoft's Windows settings guide.

macOS

Open Apple menu > System Settings > Network, select the service, then Details > DNS. See Apple's Mac DNS guide. Terminal's scutil --dns shows the resolver configuration.

Linux

Menus vary, since every distribution has its own idea of a settings screen. With systemd-resolved, run resolvectl status to see DNS servers, or resolvectl query example.com to test a name. Otherwise, check your network profile or your distribution's resolver configuration. See the resolvectl manual.

Android

On stock Android, open Settings > Network & internet > Private DNS and choose Automatic, or enter a provider hostname. Manufacturers may place it under Connections. See Google's Android network settings help.

iPhone and iPad

Open Settings > Wi-Fi, tap Info beside the connected network, then Configure DNS. This applies to that Wi-Fi network only. Cellular, VPN, or managed settings can differ. See Apple's Wi-Fi settings guide.

For a resolver change, follow our DNS server setup guide. Another resolver may help if yours is slow or unreachable, but it cannot increase your plan's capacity.

What DNS encryption and DNSSEC actually protect

Traditional queries can be visible between your device and the resolver. DNS over TLS (DoT) encrypts that channel. DNS over HTTPS (DoH) carries DNS inside HTTPS. The resolver still receives the queries, and the later website connection is separate. See RFC 7858 and RFC 8484.

DNSSEC lets validating resolvers check DNS data signatures. It does not encrypt queries. See RFC 4033.

A quick check when a site will not load

  1. Check whether one site or many fail. Confirm the hostname, then try another browser or network.
  2. Run nslookup example.com or dig example.com, and note the answer or error and the resolver.
  3. Use Loqmi's IP checker to confirm internet access and see your public IP. It does not test DNS records.
  4. If lookup succeeds but browsing fails, check the connection, VPN, browser, or site. If DNS fails, compare networks or use the resolver setup guide.

Loqmi's speed test measures connection performance, not name resolution. Use it when a page loads slowly, and use a DNS query when a hostname will not resolve. Your browser appreciates the distinction, even if it refuses to explain itself.

Key takeaways

  • DNS returns records for names. The recursive resolver looks them up, and the authoritative server publishes them.
  • A, AAAA, CNAME, MX, NS, and TXT records have different purposes.
  • DHCP assigns local network settings, NAT shares a public connection, and DNS resolves names.
  • TTL and cached negative answers explain why DNS changes may not appear everywhere at once.
  • DoH, DoT, and DNSSEC protect different things. None of them replaces the rest of your network security.

Frequently asked questions

Can a DNS lookup reveal my home address?

A DNS lookup finds records for a domain; it does not reveal a visitor's street address. The resolver you use may see the query and some network information, while a website connection can expose your public IP to that site. IP-based location is approximate and usually points to an area or provider, not a precise home address.

Will changing DNS change my IP address?

No. DNS chooses records such as the server address associated with a name. Your public IP is assigned through your internet connection, and your device may also have a separate private address on the local network. Changing a resolver does not normally change either address.

Why does one device open a site while another cannot?

The devices may use different DNS resolvers, browser-level encrypted DNS, VPN settings, or cached answers. Compare the exact hostname and network, then test a lookup with the same resolver if possible. A work or school profile can also set DNS policy that overrides the normal device setting.

Does DNS work when I use an app instead of a browser?

Usually. Apps use DNS whenever they need to find a service by name, although some apps cache addresses or use their own encrypted DNS behavior. DNS returns naming data; the app still needs a working network connection and the service itself must be available.

Sources

Related articles