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

    DNS Resolver with WAN failover

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 3 Posters 681 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.
    • B
      bhjitsense
      last edited by

      I recently setup WAN failover on my XG-7100. These are WAN and WAN2. In order for DNS to work, I have to select the Outgoing Network Interfaces for DNS resolution to be both WAN and WAN2. But the problem is WAN2 is a much slower connection. And I'm seeing that during normal operation DNS resolution is much slower. Is there a way around this? Such as only use the default gateway (whatever it is at the time) for DNS?

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

        Set your outgoing as localhost, and then it should use your default gateway.

        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

        4 B 2 Replies Last reply Reply Quote 0
        • 4
          4o4rh @johnpoz
          last edited by

          @johnpoz
          i have nat redirection to force all clients to go via pfsense.
          i also have WAN with 2 VPN connections.
          I use a static rule for those that have to go via the WAN

          I selected the outgoing interface as WAN but i had the same problems as when i selected all three.
          Intermittently dns fails both from the pfsense and clients. suspect it is when the vpn failover occurs.
          If i do a filter reload, it comes back in action.

          i will try using the localhost, but in my case, isn't that going to direct unresolve request to the root over the VPN instead of the wan?

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

            Why would your vpn be default? Just policy route..

            Such as only use the default gateway (whatever it is at the time) for DNS?

            You make no mention of vpn in your OP.. And clearly ask how to get dns to use your default route.. If you set out going interface as the localhost, it will use the default route.

            If vpn is default, then it should use that.

            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

            4 2 Replies Last reply Reply Quote 0
            • 4
              4o4rh @johnpoz
              last edited by

              @johnpoz
              i don't want outgoing traffic if both vpns going down. therefore i setup the gateway pool as the default route.
              the wan is only used for a limited number of services i.e. this forum because they don't work over the vpn.

              As the VPN switches quite frequently (even though i use member down as the criteria).
              This seems to cause instability with unresolve and i lose DNS.

              so it was correct for me to set unresolve to use the WAN interface.

              1 Reply Last reply Reply Quote 0
              • B
                bhjitsense @johnpoz
                last edited by

                @johnpoz AH! Can't believe I didn't think of that. Thanks

                1 Reply Last reply Reply Quote 0
                • 4
                  4o4rh @johnpoz
                  last edited by

                  @johnpoz but i am noticing another problem. Summary config

                  • unresolve outgoing only on wan
                  • nat rule point to localhost for dns on each interface
                  • rule on each interface to pass dns to localhost
                  • block rule on each interface to block dns not for pfsense
                  • gateway pool as default route fo 2x vpn
                  • alias defining list of hosts to bypass vpn
                  • rule to pass alias to wan

                  i am seeing every 20sec in the log
                  check_reload_status Updating static routes based on hostnames

                  on the dns resolver, i see loads of
                  Adding Action: pf table: BYPASS_VPN_HOSTS host: forum.netgate.com
                  filterdns failed to resolve forum.netgate.com will retry later again.

                  these are very frequent and seeing to coincide with my intermittent loss of DNS

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