Navigation

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

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

    DHCP and DNS
    4
    5
    280
    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
      • JKnott
        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, 64 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
          • Gertjan
            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.

            1 Reply Last reply Reply Quote 0
            • johnpoz
              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
              2440 2.4.5p1 | 2x 3100 2.4.4p3 | 2x 3100 22.01 | 4860 22.01

              1 Reply Last reply Reply Quote 0
              • First post
                Last post