DNS Resolver with WAN failover
-
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?
-
Set your outgoing as localhost, and then it should use your default gateway.
-
@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 WANI 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?
-
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.
-
@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.
-
@johnpoz AH! Can't believe I didn't think of that. Thanks
-
@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 hostnameson 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