pfSense: Dual WAN Load Balancing / Fail Over DNS (and possibly more) Issues


Recommended Posts

Hello! So I have been using pfSense for a few years now and have been very happy with it. I recently signed up for a second internet connection at home to have as a backup. After configuring everything, pfSense does indeed switch over to the second connection when the first one fails (simulated by disconnecting the cable), but DNS resolution (or possibly some other issue) doesn't seem to work, and as a result I am not able to browse the internet. I have provided some more information about my setup below. Provided some screenshots as well.

 

WAN1 is a PPPoE connection with a public routable static IPv4 address.

WAN2 is a CGNAT address and a completely locked down modem, so no Bridge Mode. pfSense just gets a private IP on the WAN2 interface.

 

pfSense running in a VM on Proxmox with 2 Ethernet cards available for it. One used for WAN1, other for LAN.

Managed Switch has a VLAN on one of the ports for the WAN2. VLAN configured in pfSense.

DNS handled by 2 Pi-hole instances, 1 is a VM on the same Proxmox host, 2nd is on a Raspberry Pi. Both Pi-holes are on their own VLAN in pfSense and DNS Redirect has been configured for the primary LAN network.

Both Pi-hole addresses specified under System/General Setup/DNS Settings. AdGuard DNS IP's provided for WAN2.

 

 

What am I doing wrong?

 

dns.png

 

gateways.png

lan rules.png

Edited by The Dark Knight
On 17/10/2022 at 07:31, The Dark Knight said:

Both Pi-hole addresses specified under System/General Setup/DNS Settings. AdGuard DNS IP's provided for WAN2.

So you setup the resolver to forward?  Out of the box unbound resolves, putting stuff in dns settings under general doesn't do anything but provide dns that pfsense itself could use.  Unless you told unbound to forward.  Also trying to redirect dot is pretty pointless.. Since the client should validate the cert of the dns its trying to talk to, trying to send that to your pihole - that shouldn't work, even if pihole was listening for dot.  Unless it presented a cert for whatever fqdn the dot client was trying to talk to.

 

So your clients get handed what for their dns, pfsense IP, and then you redirect that to pihole - that goes where then for dns?

 

Your clients should get handed pihole IPs for their dns, now your pihole should forward to where you want, or it should resolve - and it would use whatever failover you have setup for your routing, etc. In that last rule.

 

If you redirecting it?  You could have a loop in how your dns is suppose to work from that setup.

Not using DNS Forwarder, but DNS Resolver. Although I just looked at it properly, the option to forward to the DNS servers under General Setup is unticked.....yet everything works (with just one WAN). It's possible I've done something wrong here. I did this a long time back following a guide on using pfSense with Pi-hole. Maybe the guide I followed was wrong as well. But everything was working, so I didn't go deep into it. I do have both Pi-holes specified under the LAN DHCP Server settings as well.

 

On both Pi-holes I have the Cloudflare DoH service running, so my Upstream is 127.0.0.1#5053.

 

Oh ok, didn't know that redirecting DoT is not useful. But then why is the state table for it so large?

 

 

dns2.jpg

Those IPs in general dns have nothing to do with clients asking unbound, as you show unbound is resolving - not forwarding.. It will walk down from roots, then the gltds then the authoritative ns.. Those settings are only for pfsense to forward to if you it isn't asking itself (127.0.0.1) or that is down or something.

 

They would never be used by unbound (unless you set forwarding in unbound), nor would they get handed to a client to use. 

 

Your 2nd wan might be having a problem resolving? Or dns in general.. I would disable your main wan.. And then try doing some directed dns queries via pfsense.. Or a client to different dns, ask pfsense directly on its IP to look up somethiing new that is not in the cache, etc. Does it work, ask 8.8.8.8, ask cloudflare, ask quad9, etc. query the roots directly..

 

example.

 

[22.05-RELEASE][[email protected]]/root: dig

; <<>> DiG 9.16.26 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4687
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       26647   IN      NS      d.root-servers.net.
.                       26647   IN      NS      e.root-servers.net.
.                       26647   IN      NS      f.root-servers.net.
.                       26647   IN      NS      g.root-servers.net.
.                       26647   IN      NS      h.root-servers.net.
.                       26647   IN      NS      i.root-servers.net.
.                       26647   IN      NS      j.root-servers.net.
.                       26647   IN      NS      k.root-servers.net.
.                       26647   IN      NS      l.root-servers.net.
.                       26647   IN      NS      m.root-servers.net.
.                       26647   IN      NS      a.root-servers.net.
.                       26647   IN      NS      b.root-servers.net.
.                       26647   IN      NS      c.root-servers.net.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Oct 18 11:03:32 CDT 2022
;; MSG SIZE  rcvd: 239

[22.05-RELEASE][[email protected]]/root: dig @d.root-servers.net com. NS

; <<>> DiG 9.16.26 <<>> @d.root-servers.net com. NS
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39862
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 27
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1450
;; QUESTION SECTION:
;com.                           IN      NS

;; AUTHORITY SECTION:
com.                    172800  IN      NS      a.gtld-servers.net.
com.                    172800  IN      NS      b.gtld-servers.net.
com.                    172800  IN      NS      c.gtld-servers.net.
com.                    172800  IN      NS      d.gtld-servers.net.
com.                    172800  IN      NS      e.gtld-servers.net.
com.                    172800  IN      NS      f.gtld-servers.net.
com.                    172800  IN      NS      g.gtld-servers.net.
com.                    172800  IN      NS      h.gtld-servers.net.
com.                    172800  IN      NS      i.gtld-servers.net.
com.                    172800  IN      NS      j.gtld-servers.net.
com.                    172800  IN      NS      k.gtld-servers.net.
com.                    172800  IN      NS      l.gtld-servers.net.
com.                    172800  IN      NS      m.gtld-servers.net.

;; ADDITIONAL SECTION:
a.gtld-servers.net.     172800  IN      A       192.5.6.30
b.gtld-servers.net.     172800  IN      A       192.33.14.30
c.gtld-servers.net.     172800  IN      A       192.26.92.30
d.gtld-servers.net.     172800  IN      A       192.31.80.30
e.gtld-servers.net.     172800  IN      A       192.12.94.30
f.gtld-servers.net.     172800  IN      A       192.35.51.30
g.gtld-servers.net.     172800  IN      A       192.42.93.30
h.gtld-servers.net.     172800  IN      A       192.54.112.30
i.gtld-servers.net.     172800  IN      A       192.43.172.30
j.gtld-servers.net.     172800  IN      A       192.48.79.30
k.gtld-servers.net.     172800  IN      A       192.52.178.30
l.gtld-servers.net.     172800  IN      A       192.41.162.30
m.gtld-servers.net.     172800  IN      A       192.55.83.30
a.gtld-servers.net.     172800  IN      AAAA    2001:503:a83e::2:30
b.gtld-servers.net.     172800  IN      AAAA    2001:503:231d::2:30
c.gtld-servers.net.     172800  IN      AAAA    2001:503:83eb::30
d.gtld-servers.net.     172800  IN      AAAA    2001:500:856e::30
e.gtld-servers.net.     172800  IN      AAAA    2001:502:1ca1::30
f.gtld-servers.net.     172800  IN      AAAA    2001:503:d414::30
g.gtld-servers.net.     172800  IN      AAAA    2001:503:eea3::30
h.gtld-servers.net.     172800  IN      AAAA    2001:502:8cc::30
i.gtld-servers.net.     172800  IN      AAAA    2001:503:39c1::30
j.gtld-servers.net.     172800  IN      AAAA    2001:502:7094::30
k.gtld-servers.net.     172800  IN      AAAA    2001:503:d2d::30
l.gtld-servers.net.     172800  IN      AAAA    2001:500:d937::30
m.gtld-servers.net.     172800  IN      AAAA    2001:501:b1f9::30

;; Query time: 223 msec
;; SERVER: 199.7.91.13#53(199.7.91.13)
;; WHEN: Tue Oct 18 11:03:56 CDT 2022
;; MSG SIZE  rcvd: 828

[22.05-RELEASE][[email protected]]/root: 

 

  • Like 1

Ok, so I disabled WAN1 and did a Dig test like you asked.....it fails! So DNS is the issue.....

 

 

dnstest.jpg

dnstest2.jpg

Also, another thing I can't figure out why.....if I have the Fail Over group specified in the Gateway for the LAN outbound rule, even though I am able to browse the web, I can't access my Pi-hole URL's and also can't access my WAN2 modem web page! I have another VLAN with a .20 network, I can access the web servers and services on that perfectly.

 

If I change the Gateway in the outbound rule back to default, everything is accessible again.

 

Edit: I just checked, I actually can't access everything. Some work, some don't. 😵😵

 

Edit 2: If I try to access directly with the IP on the .20 network, it doesn't work. Only accessible with the domain that I have reverse proxied for those web servers. This is all when the Fail Over is specified on the LAN Outbound.

Edited by The Dark Knight

did you do that from pfsense?  That is just asking loopback, itself you didn't direct that to 8.8.8.8 you asked 127 for 8.8.8.8 you need to use the @ to tell dig where to ask.

On 18/10/2022 at 22:18, BudMan said:

did you do that from pfsense?  That is just asking loopback, itself you didn't direct that to 8.8.8.8 you asked 127 for 8.8.8.8 you need to use the @ to tell dig where to ask.

Yes, logged in via SSH to pfSense and ran the Dig command.

 

Edit: Logged in again after disabling WAN1 and ran dig @8.8.8.8. No response.

well then if you can not talk to 8.8.8.8 from pfsense, or the roots can you talk to the dns of of that connection.  It is possible for ISP to only allow dns to their dns servers.  You might see that on say a sat connection, or even cell - did you mention this was a cell sort of backup link?

I actually suspected this ISP must be forcing their DNS....but I tried just now, doesn't work either. No, this is an optical fibre connection. But locked down like hell! I had another thought.....this ISP prioritises IPv6. Could it be possible I'm facing problems because I'm trying only IPv4 in pfSense?

 

 

dnstest3.jpg

Sorry, late over here, need to go to sleep. 😄

 

Thanks for all your help so far BudMan! 😎👍

 

Want to really get this working....otherwise worst case scenario, I dump this ISP and get another connection from a not so restricted provider. I signed up with these guys because they bundle in streaming subscriptions with the internet plan, and is a damn good deal.....provided you use everything they way they want you to. Their supplied Android TV box for my TV....freaking HELL....insanely locked down!

 

that you get a timeout is odd, I actually get a refused which is more like what should happen when you try and talk to a ISP dns, but not from ISP network.

 

22.05-RELEASE][[email protected]]/root: dig @49.45.0.3

; <<>> DiG 9.16.26 <<>> @49.45.0.3
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 51706
;; flags: qr rd ad; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; Query time: 266 msec
;; SERVER: 49.45.0.3#53(49.45.0.3)
;; WHEN: Tue Oct 18 13:04:22 CDT 2022
;; MSG SIZE  rcvd: 12

[22.05-RELEASE][[email protected]]/root: dig @49.45.0.3 www.google.com

; <<>> DiG 9.16.26 <<>> @49.45.0.3 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 26050
;; flags: qr rd ad; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; Query time: 265 msec
;; SERVER: 49.45.0.3#53(49.45.0.3)
;; WHEN: Tue Oct 18 13:05:18 CDT 2022
;; MSG SIZE  rcvd: 12

[22.05-RELEASE][[email protected]]/root: 

 

But yeah if you can not do dns over this connection - what is the point of it??  It useless connection.

On 18/10/2022 at 23:36, BudMan said:

that you get a timeout is odd, I actually get a refused which is more like what should happen when you try and talk to a ISP dns, but not from ISP network.

 

But yeah if you can not do dns over this connection - what is the point of it??  It useless connection.

Ok. Yes, true, it is useless in pfSense. I can still use the connection with just their device directly via Ethernet or WiFi. Not ideal of course.

 

But what I don't understand is.....however locked down it is, since pfSense is just seen as a DHCP client by their device, shouldn't it just work?

My computers do, if I connect them to ther device. 🫤

Dns should work - kind of hard to use the internet if dns doesn't work..  When you plug your device into their device - what does it give you for dns, the IP of their device? You can set pfsense to use that for dns.

On 20/10/2022 at 04:52, BudMan said:

Dns should work - kind of hard to use the internet if dns doesn't work..  When you plug your device into their device - what does it give you for dns, the IP of their device? You can set pfsense to use that for dns.

Ok, so here's something important. There is definitely something in my configuration that is blocking pfSense from getting DNS resolution on WAN2. I created a brand new VM and setup a fresh install of pfSense. I then configured only the second connection as my primary WAN. pfSense is pulling a private IP from their device, and everything is working!

 

So it definitely works, just not in my current setup. I'm sure it has something to do with the way I am using Pi-hole for DNS resolution and also probably because of my redirect rule so that clients are forced to use my Pi-holes.

Ok. But then that still leaves the question....why isn't it working?

It's not an absolute deal breaker if it doesn't, but would be nice to be able to take advantage of automatic dual WAN functionality.

so when your connected directly to this isp device, what does your client use for dns?

 

Your saying when you redid your pfsense its now all working.. So your saying the directed queries you did before are now working?

DNS IP is showing their router IP - 192.168.29.1

 

Yes, I tested dig @8.8.8.8 and dig @d.root-servers.net com. NS like in your screenshots, works perfectly.

 

 

dnstest4.jpg

dnstest5.jpg

On 21/10/2022 at 07:49, BudMan said:

Well add your other line now..  But if dns isn't working, then yeah hard to get anywhere even if you have connectivity.

Yes, will try adding it soon. Not at home currently, so will do it tonight and test. I think I also enabled the option to let DNS be overriden by what the WAN interface gives. Not sure, can only check later today.

 

But if I do have to keep that enabled for WAN2 to work, pfSense will do that for my primary connection as well. Can I still have my Pi-hole handle DNS instead of the WAN1 DNS (they use Google DNS)?

 

 

On 21/10/2022 at 08:07, binaryzero said:

What's the gateway set to on your pi-hole, does it have internet connectivity when you failover to your secondary connection? If you've set your DNS forwarders to use pi-hole, and it can't get out..well...rip.

When I simulate WAN1 being down, WAN2 has no DNS resolution and my Pi-holes are not accessible.

 

My Pi-holes are on a seperate VLAN, and no Gateway was specified under the Interface settings on pfSense. On both Pi-holes, Upstream is Cloudflare DoH using the Cloudflared service.

What? The Pi-Holes will need a gateway to communicate to the internet...

 

If you disconnect WAN1 and DNS stops, its probably because the pi-holes have lost internet connection?

 

You can specify whatever you want as DNS servers on your LAN, use DHCP to hand out the pi-hole IPs for DNS.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • Now comes with a money back guarantee instead of a replacement! Hah
    • Rufus 4.15.2391 Beta by Razvan Serea Rufus is a small utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc. Despite its small size, Rufus provides everything you need! Oh, and Rufus is fast. For instance it's about twice as fast as UNetbootin, Universal USB Installer or Windows 7 USB download tool, on the creation of a Windows 7 USB installation drive from an ISO (with honorable mention to WiNToBootic for managing to keep up). It is also marginally faster on the creation of Linux bootable USBs from ISOs. A non-exhaustive list of Rufus supported ISOs is available here. It can be especially useful for cases where: you need to create USB installation media from bootable ISOs (Windows, Linux, UEFI, etc.) you need to work on a system that doesn't have an OS installed you need to flash a BIOS or other firmware from DOS you want to run a low-level utility Rufus 4.15.2391 Beta changelog: Improve the guards for using the "silent" option Improve the ability to cancel during write retries Fix unrestricted XML entity expansion and integer overflow in ezxml parser (courtesy of @esadowski4) [GHSA-55r2-34wg-8mv9] Fix "silent" Windows installation failing at 75% in most cases [#2960] Fix a crash during boot when using UEFI:NTFS on Snapdragon X based ARM64 platforms [#2934] Fix the first WUE option always being checked by default [#2965] Fix an infinite loop when using Windows ISOs that contain multiple WIMs Fix "Enable runtime UEFI media validation" checkbox not always being properly enabled Other WUE improvements/fixes for OneDrive removal and username validation (with thanks to @christian8641) [#2984, #2991] Download: Rufus 4.15 Beta | 1.9 MB (Open Source) Links: Rufus Home Page | Project Page @GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Media Player Classic - Home Cinema 2.7.3 by Razvan Serea Media Player Classic - Home Cinema (MPC-HC) is a free and open-source video and audio player for Windows. MPC-HC is based on the original Guliverkli project (which is no longer maintained) and contains many additional features and bug fixes. As the continuation of the original Media Player Classic, MPC-HC isn’t flashy but it works with nearly any media format. MPC-HC uses DXVA technology to pass decoding operations to your modern video card, enhancing your viewing experience. And MPC-HC supports both physical and software DVDs with menus, chapter navigation, and subtitles. Overview of features A lot of people seem to be unaware of some of the awesome features that have been added to MPC-HC in the past years. Here is a list of useful options and features that everyone should know about: Dark interface Menu > View > Dark Theme When using dark theme it is also possible to change the height of the seekbar and size of the toolbar buttons. Options > Advanced Video preview on the seekbar Options > Tweaks > Show preview on seek bar Adjust playback speed Menu > Play > Playback rate The buttons in the player that control playback rate take a 2x step by default. This can be customized to smaller values (like 10%): Options > Playback > Speed step Adjusting playback speed works best with the internal audio renderer. This also has automatic pitch correction. Options > Playback > Output > Audio Renderer MPC-HC can remember playback position, so you can resume from that point later Options > Player > History You can quickly seek through a video with Ctrl + Mouse Scrollwheel. You can jump to next/previous file in a folder by pressing PageUp/PageDown. You can perform automatic actions at end of file. For example to go to next file or close player. Options > Playback > After Playback (permanent setting) Menu > Play > After Playback (for current file only) A-B repeat - You can loop a segment of a video. Press [ and ] to set start and stop markers. You can rotate/flip/mirror/stretch/zoom the video Menu > View > Pan&Scan This is also easily done with hotkeys (see below). There are lots of keyboard hotkeys and mouse actions to control the player. They can be customized as well. Options > Player > Keys Tip: there is a search box above the table. You can stream videos directly from Youtube and many other video websites You can stream videos directly from Youtube and many other video websites Put yt-dlp.exe or youtube-dl.exe in the MPC-HC installation folder. Then you can open website URLs in the player: Menu > File > Open File/URL You can even download those videos: Menu > File > Save a copy Tip: to be able to download in best quality with yt-dlp/youtube-dl, it is recommended to also put ffmpeg.exe in the MPC-HC folder. Several YDL configuration options are found here: Options > Advanced This includes an option to specify the location of the .exe in case you don't want to put it in MPC-HC folder. Play HDR video This requires using madVR or MPC Video Renderer. After installation these renderers can be selected here: Options > Playback > Output Ability to search for and download subtitles, either automatically or manually (press D): Options > Subtitles > Misc Besides all these (new) features, there have also been many bugfixes and internal improvements in the player in the past years that give better performance and stability. It also has updated internal codecs. Support was added for CUE sheets, WebVTT subtitles, etc. Media Player Classic - Home Cinema 2.7.3 changelog: Updated LAV Filters to version 0.82 Updated MPC Video Renderer to version 0.10.4.2550 Updated MPC Audio Renderer A few crash fixes, bug fixes and small improvements. Download: MPC-HC 2.7.3 (x64) | Standalone | ~20.0 MB (Open Source) Download: MPC-HC 2.7.3 (x86) | Standalone Links: MPC-HC Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Microsoft will finally let you sign in to Edge with a Google account by Usama Jawad As things currently stand, Microsoft Edge only allows you to sign in to the browser with a Microsoft Account (MSA). This allows you to sync your browser settings and other data across other devices, as long as you sign in with the same account. However, Microsoft is now modifying this mechanism in a way that will likely please many users. In an update to its Microsoft 365 Roadmap, Microsoft has indicated that it will soon let users sign into Edge using a Google account from the profile menu and the Edge sign-in screen. This will be in addition to the MSA login option, and it opens up new doors for people who prefer using Edge, but cannot be bothered to configure a Microsoft account. This brings several advantages such as the ability to sync your data across devices using just a Google account. It may even facilitate flexible single sign-on (SSO) experiences where you can quickly login to websites and services through a single Google account that is presented as the preferred sign-in option. Up until now, Microsoft allowed customers to indirectly use a Google account, by configuring a Google account as a Microsoft account, or by setting up a one-way sync option between Edge and Chrome. This is a rather interesting development, especially considering that Google Chrome still limits you to a Google account sign-in, but it will be interesting to see if the company reciprocates Microsoft's gesture in the future. This is not the only recent instance in which Microsoft has extended a handshake to Google via Edge. In April 2026, it began tracking the development of a work search banner for Google Search queries, just like the one present in Edge. However, if we go back almost seven years, to January 2020, Microsoft had emphasized that it had no plans to "integrate Google services into Microsoft Edge by default", in response to people requesting Google sign-in services on Edge. Fast-forward to today, and Microsoft is planning to release this feature in July 2026, with IT admins having the option to control its availability on Windows and macOS through the NonMicrosoftAccountSignInEnabled policy.
    • If they ever come out and say the AI is no longer accessible to the gen pop people aren't going to know how to tie their own shoelaces.
  • Recent Achievements

    • One Month Later
      Vincian earned a badge
      One Month Later
    • First Post
      Jocimo earned a badge
      First Post
    • Week One Done
      suprememobiles48 earned a badge
      Week One Done
    • One Month Later
      Windows Guy earned a badge
      One Month Later
    • One Month Later
      Prasann earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      89
    4. 4
      Steven P.
      76
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!