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

    DNS resolver leaks (+ISP hijack)

    Scheduled Pinned Locked Moved DHCP and DNS
    8 Posts 4 Posters 3.1k 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.
    • K Offline
      kncar77
      last edited by

      Hi.

      I'm an expat in a country where the ISP is eavesdropping on everything, blocking VOIP and so on. I've got pfSense (2.3.2) up and running (limited experience with firewalls..) with a VPN client connecting back home to EU routing all traffic through the tunnel, works great. I've got an intermittent issue with DNS leakage though.

      General setup:
      Googles DNS 8.8.8.8 and 8.8.4.4 with NONE as gateway.
      DNS Server Override - deselected
      Disable DNS Forwarder - deselected

      Service -> DNS resolver:
      Enabled.
      Network interfaces: All
      Outgoing Network Interfaces: VPN-gateway

      I've found that every now and then a DNSleaktest returns my ISP's DNS instead of my VPN IP, suggesting the query is not going through the tunnel even with the above settings plus that the ISP is hijacking the google DNS. If I go into the DNS resolver, not changing a thing but click "Save", queries are then back using the tunnel again. Is there a glitch or some workaround I can use?

      I guess I can delete all DNS settings in the General setup and for the VPN-client connect straight to the VPN-server's IP rather than it's host record but that only works until the VPN provider changes it's IP on their server.

      Any info or suggestions are appreciated

      Thanks,
      Knut

      1 Reply Last reply Reply Quote 0
      • M Offline
        mauroman33
        last edited by

        Hi,

        in Services>DNS Resolver>General Settings, select DNSSEC and DNS Query Forwarding

        With DNS Query Forwarding selected, when you run a DNSleaktest it will return the DNS you have inserted in System>General Setup

        To prevent some device in your network can use a different DNS from what is set in pfSense you should add in Firewall>Rules>LAN two rules like these

        ![Anti DNS leak rules.png_thumb](/public/imported_attachments/1/Anti DNS leak rules.png_thumb)
        ![Anti DNS leak rules.png](/public/imported_attachments/1/Anti DNS leak rules.png)

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

          You do not have to forward, you just need to make sure pfsense sends all queries through your vpn.  Select your vpn interface for outgoing queries in unbound.

          And yes make sure your client your running your dns leak test through is only using pfsense for dns.

          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 25.07.1 | Lab VMs 2.8.1, 25.07.1

          1 Reply Last reply Reply Quote 0
          • M Offline
            mauroman33
            last edited by

            Totally agree with johnpoz!
            Sorry, I haven't read that you're routing ALL traffic through the tunnel.

            1 Reply Last reply Reply Quote 0
            • K Offline
              kncar77
              last edited by

              @johnpoz:

              You do not have to forward, you just need to make sure pfsense sends all queries through your vpn.  Select your vpn interface for outgoing queries in unbound.

              And yes make sure your client your running your dns leak test through is only using pfsense for dns.

              In Services/DNS Resolver/General Settings I've already selected the VPN-interface under "Outgoing Network Interfaces" as suppose to the default "All". It normally works but every now and then queries still seems to slip through the WAN interface for some weird reason and hence this topic.

              All clients on the network have pfSense's LAN IP as DNS received via DHCP (checked and double checked with all the clients)

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

                So the ONLY interface you have selected in unbound is your vpn interface?  If you have more than 1 queries can go out any of them

                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 25.07.1 | Lab VMs 2.8.1, 25.07.1

                1 Reply Last reply Reply Quote 0
                • K Offline
                  kpa
                  last edited by

                  What's in the pfSense's /etc/resolv.conf? You don't want to have anything else but 127.0.0.1 with the set up you've described.

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

                    ^ valid point, its possible its pfsense going directly to 8.8.8.8 vs using unbound via loopback.

                    But doesn't make sense why pfsense would be trying to go to the dnsleak fqdn site, which would be the only way the dnsleak site would know that dns queries are leaking.

                    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 25.07.1 | Lab VMs 2.8.1, 25.07.1

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