How DNS lookup works
DNS is a distributed, hierarchical database. When an app needs the IP address for a hostname, resolution usually follows this path:
- The app asks the operating system, which checks its local DNS cache.
- The operating system asks a recursive resolver, often run by an ISP or configured manually.
- If the answer isn’t cached, the resolver follows referrals from the DNS root to
.comand then to the domain’s authoritative server. - The authoritative server returns the record, and caches keep it for its time to live (TTL).
Common DNS records
DNS stores more than website addresses:
| Record | Purpose | Example |
|---|---|---|
| A | Maps a name to an IPv4 address | 192.0.2.25 |
| AAAA | Maps a name to an IPv6 address | 2001:db8::25 |
| CNAME | Makes one name an alias of another | www.example.com |
| MX | Identifies a domain’s mail server | mail.example.com |
A basic A record can look like this:
example.com. 300 IN A 192.0.2.25
The TTL of 300 tells resolvers they may cache the answer for 300 seconds. Until that time expires, a changed record may not appear everywhere.
DNS and proxies
DNS resolution can happen on your device or through a proxy server. With local resolution, your configured resolver sees the hostname and supplies an address before the proxy connection. With remote resolution, the client gives the hostname to the proxy, which performs the lookup.
A SOCKS5 proxy supports domain-name requests, but the client setting determines whether resolution is local or remote. Remote resolution can also produce a CDN address suited to the proxy environment rather than your local network. Changing your exit IP doesn’t automatically change which DNS resolver you use.
DNS failures and checks
- NXDOMAIN: The queried name doesn’t exist.
- SERVFAIL: The resolver couldn’t complete the lookup, possibly because an authoritative server failed or DNSSEC validation broke.
- Timeout: No DNS reply arrived before the client’s deadline.
- Stale answer: A resolver still has an older record cached until its TTL expires.
Check the exact hostname, compare answers from your app and operating system and inspect the record’s TTL. If only proxied requests fail, verify whether the client expects local or remote DNS resolution.
FAQ
Is DNS the same as an IP address?
No. DNS maps names to IP addresses and other records. One name can return several addresses, while one address can host several domain names.
Does a proxy use its own DNS?
It depends on the proxy protocol and client settings. If the client sends a hostname, the proxy can resolve it; if the client resolves first, your system’s DNS resolver is used.
What port does DNS use?
Traditional DNS uses UDP or TCP port 53. DNS over TLS commonly uses port 853, while DNS over HTTPS usually uses port 443.