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

    Local DNS over VPN

    Scheduled Pinned Locked Moved DHCP and DNS
    17 Posts 2 Posters 739 Views 2 Watching
    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.
    • V Offline
      viragomann @guile
      last edited by

      @guile
      Other idea. Do you have "redirect gateway" checked to direct the whole clients upstream traffic over the VPN?

      If so, you can easily intercept it. Just redirect the DNS traffic from the VPN client to localhost (Resolver).

      G 2 Replies Last reply Reply Quote 1
      • G Offline
        guile @viragomann
        last edited by

        @viragomann The "Redirect IPv4 Gateway" is unchecked. If i check this the clients will use Internet through VPN, right?

        V 1 Reply Last reply Reply Quote 0
        • V Offline
          viragomann @guile
          last edited by

          @guile
          Correct.

          G 1 Reply Last reply Reply Quote 1
          • G Offline
            guile @viragomann
            last edited by

            @viragomann i dont want VPN clients using internet through VPN, but ill try it. ill try this and the ACL idea.

            Thanks for now!

            1 Reply Last reply Reply Quote 0
            • G Offline
              guile @viragomann
              last edited by

              @viragomann said in Local DNS over VPN:

              If so, you can easily intercept it. Just redirect the DNS traffic from the VPN client to localhost (Resolver).

              To redirect DNS is a NAT rule, right?

              V 1 Reply Last reply Reply Quote 0
              • V Offline
                viragomann @guile
                last edited by

                @guile
                Yes, port forwarding.
                destination: any
                dest. port: 53
                redirect target: localhost 53

                Ensure that localhost is enabled in the Resolvers "Network Interfaces".

                G 2 Replies Last reply Reply Quote 1
                • G Offline
                  guile @viragomann
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    guile @viragomann
                    last edited by guile

                    @viragomann I tested and the "Redirect IPv4 Gateway" and "NAT rule" made it work.

                    BUT... I don't want all VPN clients using internet through VPN. Is there a way to make this work, without the "Redirect IPv4 Gateway" option checked?

                    V 1 Reply Last reply Reply Quote 0
                    • V Offline
                      viragomann @guile
                      last edited by

                      @guile
                      If it's a Windows client you can try to check "Block Outside DNS" in the OpenVPN server settings.

                      G 1 Reply Last reply Reply Quote 1
                      • G Offline
                        guile @viragomann
                        last edited by

                        @viragomann the redirect gateway is the best option for me, bc some clients is using mac/linux.. thanks for your help!

                        V 1 Reply Last reply Reply Quote 0
                        • V Offline
                          viragomann @guile
                          last edited by

                          @guile
                          If you know the DNS server the clients are using like OpenDNS you can also only route this over the VPN by adding its IP(s) to the "local networks" and then redirect it to pfSense. I.e. if you control the clients.

                          G 1 Reply Last reply Reply Quote 0
                          • G Offline
                            guile @viragomann
                            last edited by

                            @viragomann the problem is I have no idea which DNS each client is using. Some use ISP DNS, others Google, others OpenDNS, others quad 9.. and so on. And some clients are from others countries..

                            In this case, i think the best option is let the clients use internet through VPN.

                            Thanks for your help. I really appreciate it!

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