Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Why DNS Resolver appears to be 3x slower than DNS Forwarder?

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 3 Posters 686 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ssbarneaS
      ssbarnea
      last edited by

      I was previously using DNS Forwarder with CloudFare upstream servers and namebench reported an average resolve time of ~40ms.

      In my attempt to cache DNS entries locally, I switched to DNS Resolver and surprise, now the benchmark reports an average resolve time of about ~120ms.

      Another reason why I wanted to use DNS Resolver was to to use pfBlockerNG.

      My (home) router is far under utilised, with CPU load <5% and memory <10% (8GB), so I really doubt router load has any effects.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Have you tried it in forwarding mode? Disabling DNSSec? Does that reduce resolve time?

        Steve

        1 Reply Last reply Reply Quote 0
        • KOMK
          KOM
          last edited by

          The resolver will have to talk to the root servers if what you're asking for isn't already in cache and walk its way down the tree to the authoritative DNS. A forwarder will send the request to another upstream forwarder/resolver, usually a bigger one e.g. Google, and that one likely has what you're asking for already cached. The net result is that the forwarder appears faster due to how they operate.

          1 Reply Last reply Reply Quote 1
          • ssbarneaS
            ssbarnea
            last edited by

            @KOM I imagined this, but at the same time I observed that the benchmark result seems to remain stable, even if I run multiple times in a raw. I was expecting for the resolver performance to improve over time as its cache would be growing.

            I tried to look for some stats regarding the DNS cache but I was not able to find any hit rate in the UI.

            Is there something I can do to improve its perceived speed? Somehow I do have the impression that with ~10 clients on the network it should be possible to improve the client resolution speed by using the resolved instead of forwarder.

            I am also curious which values do other receive on the benchmarks.

            1 Reply Last reply Reply Quote 0
            • KOMK
              KOM
              last edited by

              Honestly, unless there is a problem I don't waste my time tweaking for that extra 1 ms. Netgate uses resolver by default because it just works out of the box without the need to specify upstream servers. If you're concerned with speed, use the forwarder with your ISP's local DNS.

              As for testing, DNS Bench by Steve Gibson is one such tool.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.