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

    How to query 2 DNS servers simultaneously and use the first IP that comes back

    Scheduled Pinned Locked Moved DHCP and DNS
    5 Posts 4 Posters 537 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.
    • U
      Ulysses_
      last edited by

      Is it possible to query 2 DNS servers simultaneously and use the first IP that comes back? Ie the query goes to both servers and depending on traffic one of the replies comes first and the IP in it is the one used?

      1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott
        last edited by

        I don't think so.  While a device may have more than one DNS configured, it tries the first and if that fails, tries the next.  However, it may be possible if the DNS servers have an anycast address, as is available on IPv6.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • U
          Ulysses_
          last edited by

          Just found this but not sure I understand what he is refering to. Is there a package that does the job?

          https://serverfault.com/questions/732920/how-to-do-parallel-queries-to-the-upstream-dns-using-unbound

          1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan
            last edited by

            The forwarder is still there : it's dnsmasq.

            The default resolver is Resolver (unbound), so switch from Resolver to Forwarder, and you will be using dnsmasq.
            If it still is requesting all DNS servers at ones, that I don't know.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              The forwarder does this out of the box - it will query all your ns listed not just 2.. So if you have 4 all of them will be queried at same time and the first response will be used.  Unless you enable sequential queries that is how the forwarder works.

              Why would you need to do that though?  Your going to shave off a few ms at best.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

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