Having a hell of a time with DNS Resolver and Domain / Host Overrides



  • Firstly, johnpoz - i tried man - i really tried - been at this for hours.  ;D

    So i have a Windows Server on my LAN configured to provide DNS for Windows Machines on a domain test.com.

    That then points to pfSense as a forwarder to resolve queries it doesn't know and this all works a treat.

    In pfsense i have set up the domain as test.com in the General Setup, with NO DNS servers configured.

    In the DNS resolver, i have it turned on, (Forwarder is off BTY) - listening only on interfaces i need (LAN, DMZ etc) and outgoing on LAN (idea being for the Windows Server to be contactable from other Interfaces), WAN and localhost.

    DNSSEC is ticked and thats pretty much it (Enable Forwarding Mode is OFF) so im using the root servers.

    So i have a homeserver at homeserver.test.com that i would like pfsense to be able to resolve. So in DNS overrides, i configured test.com and point that to my internal Windows Server on the LAN.

    If i then nslookup from a PC, with the default of the windows server selected and a DNS prefix of test.com, and lookup homeserver - i get the correct IP of the server.

    In nslookup if i then change to "server <pfsense ip="">" and then do homeserver i get a response from a root server, which means test.com lookups are leaking.

    So it appears to be ignoring anything i put in the override for test.com. A wireshark trace shows a DNS query going to pfsense with homeserver.test.com and a response of A or AAAA homeserver.test.com no such name.

    I have also tried specifically setting a host override of homeserver and test.com to the proper IP with no joy.

    The really weird thing here is that from pfSense, if i do an DNS lookup it resolves correctly too.

    Can anyone point me in the right direction here?</pfsense>


  • Rebel Alliance Global Moderator

    "and then do homeserver i get a response from a root server, which means test.com lookups are leaking."

    No it doesn't..  Your lookup should be homeserver.test.com

    If it was going to the public internet you would get an answer

    ;; QUESTION SECTION:
    ;homeserver.test.com.          IN      A

    ;; ANSWER SECTION:
    homeserver.test.com.    3600    IN      A      69.172.200.109

    ;; Query time: 72 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Fri Aug 25 13:26:25 CDT 2017
    ;; MSG SIZE  rcvd: 64

    "I have also tried specifically setting a host override of homeserver and test.com to the proper IP with no joy."

    My guess is you put the in the WRONG place.. ie the forwarder vs the resolver, etc.  Or the resolver never actually took the setting.

    Creating a host override for anything takes all of .2 seconds to do.. See attached.. Without picture I can not tell where your going wrong..  If you can not get this to work, or getting SOA for looking up homeserver.test.com – when this resolves on the public internet then you got something wrong yes.






  • To add to JohnPoz - To be thorough; do a ipconfig renew and ipconfig /flushdns - and restart the DNS Resolver services on pfSense.



  • @johnpoz:

    "and then do homeserver i get a response from a root server, which means test.com lookups are leaking."

    No it doesn't..  Your lookup should be homeserver.test.com

    If it was going to the public internet you would get an answer

    ;; QUESTION SECTION:
    ;homeserver.test.com.          IN      A

    ;; ANSWER SECTION:
    homeserver.test.com.    3600    IN      A      69.172.200.109

    ;; Query time: 72 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Fri Aug 25 13:26:25 CDT 2017
    ;; MSG SIZE  rcvd: 64

    "I have also tried specifically setting a host override of homeserver and test.com to the proper IP with no joy."

    My guess is you put the in the WRONG place.. ie the forwarder vs the resolver, etc.  Or the resolver never actually took the setting.

    Creating a host override for anything takes all of .2 seconds to do.. See attached.. Without picture I can not tell where your going wrong..  If you can not get this to work, or getting SOA for looking up homeserver.test.com – when this resolves on the public internet then you got something wrong yes.

    Ok,
      Your right it should be homeserver.test.com - but with nslookup / DNS on windows there is a DNS suffix - in my case test.com - which is appended to my queries like "homeserver" automagically - confirmed with wireshark e.g, if i was to query homeserver.test.com it would actually be looking for homeserver.test.com.test.com.

    Wireless LAN adapter WiFi:

    Connection-specific DNS Suffix  . : test.com

    So pfSense gets homeserver.test.com as the DNS name requested and i DO end up with a root server response

    PS C:\WINDOWS\system32> nslookup
    Default Server:  UnKnown
    Address:  192.168.1.10  –- Windows Server DNS on LAN

    homeserver
    Server:  UnKnown
    Address:  192.168.1.10

    Name:    homeserver.test.com  -- note the test.com suffix
    Address:  192.168.1.8

    server 192.168.1.1 -- change to pfSense box
    Default Server:  [192.168.1.1]
    Address:  192.168.1.1

    homeserver
    Server:  [192.168.1.1]
    Address:  192.168.1.1

    Non-authoritative answer:
    Name:    homeserver.com – actually resolves to a popular site - i am changing these responses for privacy though
    Address:  62.xx.xx.xxx

    I am defiantly doing this in the resolver - the forwarder is disabled.

    Finally - JuantonJohn - i dont need to flush the DNS cache on the clients as im directly querying the servers every time with the nslookup.

    What is confusing me here is that DNS lookup on the pfsense box itself returns the correct result.


  • Netgate

    You need to make the client you are testing from use the correct default domain suffixes. It needs to specifically ask for homeserver.test.com.

    What does 192.168.1.1 return when asked to resolve homeserver.test.com. ??

    Note: windows nslookup sucks. Use something with dig or drill.

    See Also: DNS Suffix Search List in ipconfig /all.


  • Rebel Alliance Global Moderator

    homeserver
    Server:  [192.168.1.1]
    Address:  192.168.1.1

    this is NOT a valid query via nslookup if looking for homeserver.test.com

    when you are wanting to do a query direct you should make sure you end fqdn with a . so that you don't get stuff appended with nslookup… It really is almost horrific to work with.  One of the first things I install on any windows machine I have to use is dig..  Its FREE and installs in seconds.. Just grab it from https://www.isc.org/downloads/  click on bind and then grab what version you want, just install the tools when you run the install or you end up with a full bind install ;)  I normally use the ED version..

    That you get this
    Default Server:  [192.168.1.1]
    Address:  192.168.1.1

    Vs the name via the PTR your client should do - see mine comes back pfsense.local.lan tells me you got something jacked…




  • Thanks folks,
      I think i've managed to locate the issue, i had a NAT rule setup incorrectly which was redirecting my DNS traffic in a way i did not intend it too.

    I spent way too long on this, even went as far as renaming my internal domain away from a .local to my test.com (which i needed to do anyway as its bad practice.)

    Apologies for wasting your time here.



  • @ProxyMoron:

    I spent way too long on this,…

    This is how you learn.  When you're comfortable, you can help others out on here, pay it forward.
    I can't fathom the number of hours I spent building and breaking stuff in pfSense and in my homelab network(s)!!