{"id":3416,"date":"2013-12-03T13:52:16","date_gmt":"2013-12-03T19:52:16","guid":{"rendered":"https:\/\/dcmblogmulti.wpengine.com\/?p=3416"},"modified":"2026-10-13T13:04:51","modified_gmt":"2026-10-13T13:04:51","slug":"improving-dns-resolution-time-network-monitoring","status":"publish","type":"post","link":"https:\/\/www.dotcom-monitor.com\/blog\/improving-dns-resolution-time-network-monitoring\/","title":{"rendered":"How to Improve DNS Resolution Time Through Network Monitoring"},"content":{"rendered":"

\"A<\/p>\n

A DNS lookup that takes 300 ms adds 300 ms to every first visit, every API call from a new client, and every uptime check you run. Your web server never sees that time. It shows up as a blank tab before the first byte arrives.<\/p>\n

Most performance work goes into the page itself: images, JavaScript, cache headers, CDN rules. DNS resolution time gets less attention because it happens before any of that, and testing from your own laptop usually returns a cached answer in under a millisecond.<\/p>\n

The lookup is slow for your users, not for you. Monitoring from outside your own network is how you find that out, and how you confirm a fix worked. This guide covers what to measure, how to read the numbers, and which fix matches which symptom.<\/p>\n

What Happens During DNS Resolution?<\/h2>\n

DNS resolution turns a hostname like www.example.com<\/code> into an IP address, and it takes anywhere from zero to five network round trips depending on what is already cached along the way.<\/p>\n

    \n
  1. Local cache.<\/strong> The browser and operating system check their own cache first. A hit returns in well under a millisecond and sends nothing over the network.<\/li>\n
  2. Recursive resolver.<\/strong> On a miss, the query goes to the configured recursive resolver: the ISP’s, a corporate resolver, or a public one such as Cloudflare 1.1.1.1 or Google 8.8.8.8. If the resolver has the record cached, it answers immediately.<\/li>\n
  3. Root nameserver.<\/strong> On a resolver miss, the resolver asks a root server which nameservers handle the top-level domain. Root and TLD referrals are cached at almost every resolver, so this hop rarely costs anything in practice.<\/li>\n
  4. TLD nameserver.<\/strong> The resolver asks the .com<\/code> servers which nameservers are authoritative for example.com<\/code>.<\/li>\n
  5. Authoritative nameserver.<\/strong> The resolver queries your nameservers, gets the A or AAAA record, caches it for the record’s TTL, and returns it to the client.<\/li>\n<\/ol>\n

    You control step 5, and you control the TTL that decides how often steps 2 through 5 repeat. Your users’ networks control steps 1 and 2. That split is why measuring from your own machine tells you so little: your laptop’s cache and your office resolver are not the ones a customer in Frankfurt uses.<\/p>\n

    \"Diagram
    The site owner controls the authoritative hop and the TTL. Everything before it belongs to the user’s network.<\/figcaption><\/figure>\n

    What Is a Good DNS Resolution Time?<\/h2>\n

    A cached answer from a nearby recursive resolver typically returns in under 20 ms. A full uncached lookup that walks all the way to your authoritative servers is usually acceptable at 50 to 100 ms, and most teams treat anything consistently above 150 ms as worth tracing. These are rules of thumb rather than standards; the right target depends on where your users are and where your nameservers are. Our glossary entry on DNS performance<\/a> covers the metrics in more detail.<\/p>\n

    Look at the p95 by location rather than a global average. An average of 60 ms can hide a region where every lookup takes 400 ms. And measure the uncached path, the lookup that misses the resolver cache and reaches your nameservers, separately. A resolver cache hit tells you about the resolver, not about your DNS.<\/p>\n

    \n\n\n\n\n\n\n\n\n
    Measurement<\/th>\nTypical<\/th>\nWorth investigating<\/th>\n<\/tr>\n<\/thead>\n
    Resolver cache hit<\/td>\nUnder 20 ms<\/td>\nOver 50 ms suggests a slow or distant resolver<\/td>\n<\/tr>\n
    Full uncached lookup (root to authoritative)<\/td>\n50 to 100 ms<\/td>\nOver 150 ms from any region<\/td>\n<\/tr>\n
    Authoritative response alone (direct query)<\/td>\nUnder 30 ms from nearby locations<\/td>\nOver 100 ms, or any timeouts<\/td>\n<\/tr>\n
    SERVFAIL, NXDOMAIN, or timeout rate<\/td>\nZero on valid names<\/td>\nAny sustained rate above zero<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

    Why Measure DNS From Outside Your Network?<\/h2>\n

    Running nslookup<\/code> or dig<\/code> from a workstation almost always returns a cached answer, and even an uncached one goes through your corporate resolver. Neither path matches what a first-time visitor on a mobile carrier in Tokyo goes through.<\/p>\n

    Synthetic network monitoring<\/a> runs the lookup from agents in the regions your users live in, on a schedule, with caching under your control. Dotcom-Monitor’s DNS monitoring<\/a> queries your authoritative nameservers directly instead of asking a public resolver, so the time you see is the time your nameservers took, from 30+ locations, as often as once per minute.<\/p>\n

    Caching control is the part most tools skip. On any Dotcom-Monitor task you choose how the agent resolves hostnames: Device Cached, Non-Cached, TTL Cached, or through a specific External DNS Server. Non-Cached gives you comparable timing on every run. TTL Cached behaves like a visitor’s browser. The guide to DNS resolve modes<\/a> covers when to use each.<\/p>\n

    How to Improve DNS Resolution Time in 5 Steps<\/h2>\n

    Step 1: Baseline Resolution Time From Multiple Locations<\/h3>\n

    Set up two kinds of checks before changing anything. Query your authoritative nameservers directly to measure the part you control. Then resolve the same hostnames through a public resolver, using External DNS Server mode pointed at 1.1.1.1 or 8.8.8.8, to see what a user behind that resolver gets after a cache miss.<\/p>\n

    Run both from the regions that carry your traffic: North America, Europe, and Asia-Pacific at minimum, and ideally every region in your analytics top ten. For each location, record lookup time, response code (NOERROR, NXDOMAIN, SERVFAIL), and timeouts. The global monitoring network<\/a> page lists the available vantage points.<\/p>\n

    Let the checks run for a week before drawing conclusions. Plus, DNS timing moves with time of day and with resolver cache state, and one afternoon of data mostly shows you noise.<\/p>\n

    Step 2: Separate Authoritative Latency From Resolver Latency<\/h3>\n

    Compare the two baselines. If direct queries to your nameservers are fast from every location but resolver lookups are slow, the delay is upstream of you: a distant or overloaded resolver, or a CNAME chain the resolver has to walk. But if direct queries are slow from some regions, the problem is nameserver placement or your DNS provider’s network.<\/p>\n

    On the command line, dig @ns1.yourprovider.net www.example.com<\/code> reports Query time<\/code> for the authoritative hop alone, and dig +trace www.example.com<\/code> walks the full chain with timing at each referral. One machine confirms a hypothesis; the monitoring data tells you if it holds across regions and across days.<\/p>\n

    Step 3: Find the Slow Hop<\/h3>\n

    Most slow lookups fall into a handful of patterns, and each pattern points at a different cause.<\/p>\n