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

    Local vs VPN DNS Name Resolution

    Scheduled Pinned Locked Moved OpenVPN
    26 Posts 4 Posters 7.6k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by

      Ok - from a quick test when I got into the office, I set client to redirect-gateway def1

      now get this in my route print for default, before I was not redirecting

      Active Routes:
      Network Destination        Netmask          Gateway      Interface  Metric
                0.0.0.0          0.0.0.0      10.56.41.1      10.56.41.36    10
                0.0.0.0        128.0.0.0      10.0.200.5      10.0.200.6    20

      Now what I noticed right off the bat was that it was sending dns to my local configured dns at 10.56.144.11 and 10.56.144.21 down my vpn connection.  This is all it was doing it was not sending anything to my 192.168.1.253 dns (pfsense) down the vpn..

      So as suggested I added couple more entries fro dns to openvpn config.. so it handed out 192.168.1.253 3 times

      Ethernet adapter vpn:

      Connection-specific DNS Suffix  . : local.lan
        Description . . . . . . . . . . . : TAP-Windows Adapter V9
        Physical Address. . . . . . . . . : 00-FF-5A-2F-7E-EA
        DHCP Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IPv4 Address. . . . . . . . . . . : 10.0.200.6(Preferred)
        Subnet Mask . . . . . . . . . . . : 255.255.255.252
        Lease Obtained. . . . . . . . . . : Tuesday, May 27, 2014 10:19:14 AM
        Lease Expires . . . . . . . . . . : Wednesday, May 27, 2015 10:19:14 AM
        Default Gateway . . . . . . . . . :
        DHCP Server . . . . . . . . . . . : 10.0.200.5
        DNS Servers . . . . . . . . . . . : 192.168.1.253
                                            192.168.1.253
                                            192.168.1.253
        NetBIOS over Tcpip. . . . . . . . : Enabled

      Now watching dns queries with wireshark - I only see dns queries to my pfsense box down the vpn.. Nothing going local at all.

      Ok something is weird, I disconnected and connected again and now its only sending queries to my local dns - but down the gateway..  I don't have dns on my local segment to test that scenario.  Windows can do some odd shit for sure..  In this scenario you would be good because the queries would just go nowhere down your tunnel to those addresses..  If your worried about dns leakage, I would prob use a proxy on your vpn side and set your browser to use that proxy and setup in firefox for example the socks dns setting.

      querydns.png
      querydns.png_thumb

      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

      1 Reply Last reply Reply Quote 0
      • N
        NOYB
        last edited by

        Pippin, Maybe this would be a better place to continue the "block-outside-dns" discussion from https://forum.pfsense.org/index.php?topic=110910.0
        https://forum.pfsense.org/index.php?topic=110910.msg617893#msg617893

        So verb 4 shows the logs as you have too.  So my only issue with this is that it eliminates resolution of local names.  Need those some places.

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

          continue??  this thread was from 2014 ;)

          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

          1 Reply Last reply Reply Quote 0
          • PippinP
            Pippin
            last edited by

            Hmm, ok I see, the difference is that I'm not in a road worrier situation.
            Connecting from home to my external server (NAS) which runs (adblocking) DNS and I can still talk to local.

            Maybe ask over at OpenVPN Community Forum or even better on the users mailing list?

            I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
            Halton Arp

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

              "Connecting from home to my external server"

              How is that not a road warrior connection??  You don't have a site to site setup do you?  If its not site to site then your road warrior.

              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

              1 Reply Last reply Reply Quote 0
              • PippinP
                Pippin
                last edited by

                I mean as in local is my home and my home is not switching networks  :)

                I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
                Halton Arp

                1 Reply Last reply Reply Quote 0
                • N
                  NOYB
                  last edited by

                  @johnpoz:

                  continue??  this thread was from 2014 ;)

                  Continuing from the other thread that we had hijacked.
                  Yes this thread is from 2014.  Is my thread that I started on the specific subject of local vs. VPN DNS name resolution, or more concisely put "DNS leakage", and previously there had not been a solid resolution to the issue.  So it is a very direct fit for the newly implemented "block-outside-dns" option discussion.

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

                    So what exactly do you want again.

                    So you want to use your vpn dns, but not your local dns to resolve stuff other than local?  Is that what your after?  Yeah not going to happen..  How do you control your client to only ask the local dns where its at for stuff that is local, and ask your vpn dns for everything else..

                    Or am I missing something?

                    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

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

                      I believe the following is possible when the client is MS Windows:

                      • The TUN/TAP adapter on the client gets an adapter specific DNS domain name.
                      • The DNS resolvers pushed from the OpenVPN server are associated with the TUN/TAP adapter on the client.
                      • DNS names ending with this adapter specific DNS domain name get resolved by the adapter specific DNS forwarders which can be directed over the VPN tunnel using routes.

                      Of course none of this will work on any other operating system.

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

                        "DNS names ending with this adapter specific DNS domain name get resolved by the adapter specific DNS forwarders which can be directed over the VPN tunnel using routes."

                        Where did you get that idea from?? Where is the MS article that says dns is used based upon connection specific domains or search order?

                        That is not how it works…
                        https://technet.microsoft.com/en-us/library/dn305896.aspx

                        Now per the above there was an API that allows a program do do name resolution out a specific interface... Are you writing the program to tell your browser what to resolve and from where to use this API?  Or any of your other applications you might use?  They made some changes to the binding order of how name resolution is done.  But I have not read anywhere that if I put a specific domain name on a specific interface that that is the dns servers it uses for name resolution of that domain name..  But will for sure test it on monday when get to work..  Because what I can tell you from every single day using vpn into home network and resolving different things both locally and remotely.. That is not how it works on windows 7 for sure.. But sure I will double check it..

                        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

                        1 Reply Last reply Reply Quote 0
                        • N
                          NOYB
                          last edited by

                          Pippin,
                          I'm thinking/wondering if maybe the name resolution you are getting for local services is WINS.  With the block outside dns enabled I can for example ping via local host name even though there is no DNS resolution of the name.  Though there is a slight second or two delay in resolving the address since WINS is later in the resolution order.

                          John,
                          Pretty much.  Yes, I want to have my cake and eat it too.  I want local names resolution for local resources only, and VPN provided DNS only for everything else.  I know it doesn't work like that.  But that's how I want it to work.

                          1 Reply Last reply Reply Quote 0
                          • PippinP
                            Pippin
                            last edited by

                            Will try to find why its working for me. That machine as I just discovered, is getting detected through NetBIOS so yes maybe its WINS.

                            Under Network select View-Details, then right click on the columns (Name-Category-Workgroup-etc.) and select "Discovery Method".
                            Then you can see how they`re discovered, obviously  :o

                            I hope thats clear enough because I dont have English version of Windows  :)

                            I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
                            Halton Arp

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