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

    DNS Resolver not working as expected

    DHCP and DNS
    3
    9
    2.1k
    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.
    • A
      abockhold
      last edited by

      Hello,

      I've got two branch offices A and B (both on 2.3.3-RELEASE-p1) connected via OpenVPN to a central VPN concentrator (2.4.1-RELEASE). Routing and firewalling is ok, ping works from both offices to each other and to the concentrator. On both sides I have set up the DNS resolver with domain overrides to forward queries for the other office to its respective DNS server. Both offices show on the dashboard 127.0.0.1, 192.168.104.254 (office A) and 127.0.0.1, 192.168.105.254 (office B) respectively as DNS servers (in this order). 192.168.104.0/24 and 192.168.105.0/24 are the networks on the WAN (!) side.

      Trying to resolve a local and a remote name from office A works. But from office B the resolving of a remote name fails.

      I tried it on the console of pfSense with option 8 (Shell) and I get a correct answer on office A

      nslookup
      > dc01.officeb.lan
      Server:         127.0.0.1
      Address:        127.0.0.1#53
      
      Non-authoritative answer:
      Name:   dc01.officeb.lan
      Address: 192.168.5.1
      >
      

      On office B I get an error

      nslookup
      > dc01.officea.lan
      Server:         192.168.105.254
      Address:        192.168.105.254#53
      
      ** server can't find dc01.officea.lan: NXDOMAIN
      

      Why does office B ask the upstream DNS and not the resolver on localhost? I think I should have configured both machines identitcal…

      Thanks in advance!

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

        those are both of pfsense boxes?

        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.7.2, 24.11

        1 Reply Last reply Reply Quote 0
        • A
          abockhold
          last edited by

          All three are pfSense boxes - both branch offices and hub-and-spoke point.

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

            well the 1 pfsense box that is not pointing to loopback 127.0.0.1 is not out of the box setup… Out of the box pfsense would run the resolver and point to itself (127.0.0.1)..

            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.7.2, 24.11

            1 Reply Last reply Reply Quote 0
            • A
              abockhold
              last edited by

              Exactly! But unfortunately I have not knowingly configured "something strange". So the question is: how do I get this pfSense back to behave like out of the box? Thanks!

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

                Do you have let dhcp dns overrride set?

                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.7.2, 24.11

                1 Reply Last reply Reply Quote 0
                • A
                  abockhold
                  last edited by

                  Which option do you mean exactly? I've had a look in the "DHCP Server" and "DNS Resolver" areas and I am not really sure? Thanks!

                  What I noticed now: after it first went ok on side office A it now stopped working and shows the same result as in office B. Unfortunately I did not change any settings in the meantime?!

                  1 Reply Last reply Reply Quote 0
                  • DerelictD
                    Derelict LAYER 8 Netgate
                    last edited by

                    You have to set the source interface in the resolver to be something that is interesting to the other side (is an OpenVPN remote network there) so replies come back properly.

                    If it is a point-to-point OpenVPN you can probably assign an interface to the side receiving the query and make sure the traffic doesn't match the rules on the OpenVPN tab and use the benefit of reply-to to get the same result.

                    This is the one place where dnsmasq (DNS Forwarder) shines over unbound (DNS Resolver). You can set a source address of the DNS query on a per-domain-override basis.

                    Chattanooga, Tennessee, USA
                    A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                    DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                    Do Not Chat For Help! NO_WAN_EGRESS(TM)

                    1 Reply Last reply Reply Quote 0
                    • A
                      abockhold
                      last edited by

                      Thanks for your answer. Unfortunately I have to ask again as I'm too new to this stuff. I don't really understand what you are explaining to me.

                      As far as I understand you I have to correct the configuration of the DNS forwarder at office A and office B (the configuration on the VPN concentrator "hub" can be unchanged). Currently both "Network Interfaces" and "Outgoing Network Interfaces" are set to "All" at both offices.

                      The OpenVPN connection is indeed peer-to-peer between office A and the hub and office B and the hub each.

                      My problem seems to be that e.g. office B (LAN 192.168.5.0/24 with WAN address 192.168.105.1) does not direct it's DNS query into the tunnel but directly to it's uplink DNS server (which is 192.168.105.254).

                      Should I update pfSense (from 2.3.3-RELEASE-p1 to 2.4.1-RELEASE)? Might that help?

                      Thanks for your patience!

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