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

    DNS Resolver Host Override not working in Windows

    Scheduled Pinned Locked Moved DHCP and DNS
    28 Posts 3 Posters 2.7k 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.
    • S
      shawn8888
      last edited by

      Thanks for the reply, KOM!

      OK, I changed the www.facebook.com entry and I also changed the IP.
      It resolves perfectly in my pssense box, not my Windows. Why?

      DNS.Issue.3.png

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

        You sure your not doing some sort of redirect on your lan rules? Sending your queries for dns somewhere else?

        You can tell something is clearly wrong since you should resolve the PTR for that 192.168.100.2 to your pfsense name..

        its really as simple as create the rule that is what answers both for A or ptr..
        override.png

        here..

        > aaa.testdomain.com
        Server:  sg4860.local.lan
        Address:  192.168.9.253
        
        ------------
        Got answer:
            HEADER:
                opcode = QUERY, id = 9, rcode = NXDOMAIN
                header flags:  response, auth. answer, want recursion, recursion avail.
                questions = 1,  answers = 0,  authority records = 0,  additional = 0
        
            QUESTIONS:
                aaa.testdomain.com.local.lan, type = A, class = IN
        
        ------------
        ------------
        Got answer:
            HEADER:
                opcode = QUERY, id = 10, rcode = NXDOMAIN
                header flags:  response, auth. answer, want recursion, recursion avail.
                questions = 1,  answers = 0,  authority records = 0,  additional = 0
        
            QUESTIONS:
                aaa.testdomain.com.local.lan, type = AAAA, class = IN
        
        ------------
        ------------
        Got answer:
            HEADER:
                opcode = QUERY, id = 11, rcode = NOERROR
                header flags:  response, auth. answer, want recursion, recursion avail.
                questions = 1,  answers = 1,  authority records = 0,  additional = 0
        
            QUESTIONS:
                aaa.testdomain.com, type = A, class = IN
            ANSWERS:
            ->  aaa.testdomain.com
                internet address = 100.100.100.100
                ttl = 3600 (1 hour)
        
        ------------
        ------------
        Got answer:
            HEADER:
                opcode = QUERY, id = 12, rcode = NOERROR
                header flags:  response, auth. answer, want recursion, recursion avail.
                questions = 1,  answers = 0,  authority records = 0,  additional = 0
        
            QUESTIONS:
                aaa.testdomain.com, type = AAAA, class = IN
        
        ------------
        Name:    aaa.testdomain.com
        Address:  100.100.100.100
        
        > 100.100.100.100
        Server:  sg4860.local.lan
        Address:  192.168.9.253
        
        ------------
        Got answer:
            HEADER:
                opcode = QUERY, id = 13, rcode = NOERROR
                header flags:  response, auth. answer, want recursion, recursion avail.
                questions = 1,  answers = 1,  authority records = 0,  additional = 0
        
            QUESTIONS:
                100.100.100.100.in-addr.arpa, type = PTR, class = IN
            ANSWERS:
            ->  100.100.100.100.in-addr.arpa
                name = AAA.testdomain.com
                ttl = 3600 (1 hour)
        
        ------------
        Name:    AAA.testdomain.com
        Address:  100.100.100.100
        
        >
        

        You have anything in the customer box... I would up your logging to like 5, and set it to log queries and answers.

        in custom option box

        server:
        log-queries: yes
        log-replies: yes
        

        Do your queries what do you see?

        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

        S 1 Reply Last reply Reply Quote 0
        • S
          shawn8888 @johnpoz
          last edited by shawn8888

          @johnpoz

          pfsense DNS resolver -> Customer Options is clear/empty.
          Clearly, I know something is wrong, but I don't know where to troubleshoot other than ipconfig/all to check the DNS.
          The only thing I can think of would be the VPN I installed, but it is disconnected now.

          When I do nslookup in windows, it shows:

          Server:  UnKnown
          Address:  192.168.100.2
          

          So the address is correct and it should talk to my pfsense, right? Then why doesn't pfsense return the correct result as what shows in the Diagnostic box?

          I can set the log level from 1 to 5. Then what?

          BTW, I am new to pfsense, and I am not a network guru...

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

            If you were asking pfsense for its own name which is what the 192.168.100.2 is then it would be answering.

            Yes a VPN policy route rule could keep it from talking to pfsense - please post up your lan rules, do you have any floating rules. Your not doing any port forwards on your lan interface are you?

            Logging in unbound will show us that it actually got asked... For example

            Apr 30 13:34:05 	unbound 	42007:1 	info: 192.168.9.100 aaa.testdomain.com. A IN NOERROR 0.000000 1 63
            Apr 30 13:34:05 	unbound 	42007:1 	info: 192.168.9.100 aaa.testdomain.com. A IN 
            

            here is where I asked for aaa.testdomain.com who asked 192.168.9.100, and that it was answered..

            My guess is your not asking unbound on pfsense at all, or its totally borked. Did you mess with the ACLs?

            My guess is your redirecting to something other than pfsense for dns.

            BTW, I am new to pfsense, and I am not a network guru...

            hehe - don't worry that pretty clear from the get go ;) hehehehe

            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
            • S
              shawn8888
              last edited by shawn8888

              Firewall Floating rules is empty.
              How do I post my lan rules?
              NAT/Port Forwarding:
              YES! I do a lot NAT to route the traffic on WAN, but nothing on LAN interface, and nothing about 53 port to mess up the DNS.

              The logs at "Status/System Logs/System/DNS Resolver" are massive but doesn't show anything when do nslookup in windows.

              Not sure what ACLs is. Guess I am not using it.

              Also, I can browse Internet on this Windows box without any problems. So some DNS must be working...

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

                @shawn8888 said in DNS Resolver Host Override not working in Windows:

                How do I post my lan rules?

                Simple screenshot works best..
                lanrules.png

                So are you logs over flowing? Turn the logging down back to 1 and just leave in my

                server:
                log-queries: yes
                log-replies: yes
                

                In the custom option box.. you should then see the queries your clients are asking for... If your NOT... then unbound is not being asked - for whatever reason that is... pfsense is no actually 192.168.100.2 - there is a different 192.168.100.2 on your network? You have some rule forcing dns out some other path, etc. etc.

                But if unbound doesn't actually get asked, then its not possible for it to return your overrides.

                So some DNS must be working...

                Doesn't have to be pfsense, could be proxy your using as well..

                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
                • S
                  shawn8888
                  last edited by

                  OK, Here is the LAN rules:
                  LAN.Rules.png

                  DNS Resolver -> Display Custom Options
                  I input the code below as you requested:

                  server:
                  log-queries: yes
                  log-replies: yes
                  

                  So I went to pfSense Diagnostics -> dns lookup
                  And I got this in my log:

                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 . NS IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 . NS IN NOERROR 0.000000 1 228
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. A IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. A IN NOERROR 0.000000 1 50
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. AAAA IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. AAAA IN NOERROR 0.000000 1 34
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com.phub.net.cable.rogers.com. AAAA IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com.phub.net.cable.rogers.com. AAAA IN NXDOMAIN 0.000000 1 121
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. CNAME IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com. CNAME IN NOERROR 0.000000 1 34
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com.phub.net.cable.rogers.com. CNAME IN
                  Apr 30 15:22:45 	unbound 	83793:0 	info: 127.0.0.1 www.facebook.com.phub.net.cable.rogers.com. CNAME IN NXDOMAIN 0.000000 1 121 
                  

                  However, when I do nslookup in Windows, I got nothing!

                  But I can ping 192.168.100.2.

                  c:\>ping 192.168.100.2
                  
                  Pinging 192.168.100.2 with 32 bytes of data:
                  Reply from 192.168.100.2: bytes=32 time<1ms TTL=64
                  Reply from 192.168.100.2: bytes=32 time<1ms TTL=64
                  Reply from 192.168.100.2: bytes=32 time<1ms TTL=64
                  Reply from 192.168.100.2: bytes=32 time<1ms TTL=64
                  
                  Ping statistics for 192.168.100.2:
                      Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
                  Approximate round trip times in milli-seconds:
                      Minimum = 0ms, Maximum = 0ms, Average = 0ms
                  
                  

                  Any other ideas?

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

                    well if unbound is not showing you that it got asked, then it didn't get asked.

                    How exactly is this box your doing the queries from connected to pfsense that is on 192.168.100.2?

                    Look in your windows arp table on windows - the mac is pfsense mac?

                    example

                    $ arp -a
                    
                    Interface: 192.168.9.100 --- 0x10
                      Internet Address      Physical Address      Type
                      192.168.9.3           00-08-a2-0c-e6-24     dynamic
                      192.168.9.10          00-11-32-7b-29-7d     dynamic
                      192.168.9.11          00-11-32-7b-29-7e     dynamic
                      192.168.9.65          02-11-32-29-00-3b     dynamic
                      192.168.9.99          70-6e-6d-f3-11-93     dynamic
                      192.168.9.101         00-13-3b-2f-67-63     dynamic
                      192.168.9.201         00-13-3b-2f-67-63     dynamic
                      192.168.9.206         00-21-70-7b-a9-a7     dynamic
                      192.168.9.253         00-08-a2-0c-e6-24     dynamic
                    

                    My pfsense is that .253 -- and that is its mac..

                    look on your status interfaces page

                    LAN Interface (lan, igb0)
                    Status     up
                    MAC Address     00:08:a2:0c:e6:24 - ADI Engineering
                    IPv4 Address     192.168.9.253
                    Subnet mask IPv4     255.255.255.0
                    

                    If that shows valid - you sure yoru box is not running something that is hijacking your dns queries..

                    Run a sniff on your box when you dns query.. Wireshark is free and easy to use - install it on your windows machine... Do some nslookups like you were doing and then post up the pcap so we can take a look..

                    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
                    • S
                      shawn8888
                      last edited by

                      Here is the arp. I have installed vmware workstation, so there are some v-NICs

                      c:\>arp -a
                      
                      Interface: 192.168.193.1 --- 0x4
                        Internet Address      Physical Address      Type
                        192.168.193.254       00-50-56-f8-2e-d8     dynamic
                        192.168.193.255       ff-ff-ff-ff-ff-ff     static
                        224.0.0.2             01-00-5e-00-00-02     static
                        224.0.0.22            01-00-5e-00-00-16     static
                        224.0.0.251           01-00-5e-00-00-fb     static
                        224.0.0.252           01-00-5e-00-00-fc     static
                        230.0.0.1             01-00-5e-00-00-01     static
                        234.48.35.103         01-00-5e-30-23-67     static
                        239.192.152.143       01-00-5e-40-98-8f     static
                        239.255.255.250       01-00-5e-7f-ff-fa     static
                        255.255.255.255       ff-ff-ff-ff-ff-ff     static
                      
                      Interface: 192.168.100.100 --- 0x7
                        Internet Address      Physical Address      Type
                        192.168.100.1         c0-c1-c0-7d-dd-22     dynamic
                        192.168.100.2         00-50-56-9a-31-cd     dynamic
                        192.168.100.3         94-0c-6d-1b-08-8e     dynamic
                        192.168.100.52        a4-e4-b8-6c-55-b4     dynamic
                        192.168.100.103       74-d4-35-07-1f-b5     dynamic
                        192.168.100.140       00-0c-29-a9-96-19     dynamic
                        192.168.100.150       18-03-73-cf-7e-1e     dynamic
                        192.168.100.151       00-0c-29-13-e6-79     dynamic
                        192.168.100.155       00-11-32-2c-a6-03     dynamic
                        192.168.100.190       00-0c-29-82-d9-11     dynamic
                        192.168.100.255       ff-ff-ff-ff-ff-ff     static
                        224.0.0.2             01-00-5e-00-00-02     static
                        224.0.0.22            01-00-5e-00-00-16     static
                        224.0.0.251           01-00-5e-00-00-fb     static
                        224.0.0.252           01-00-5e-00-00-fc     static
                        230.0.0.1             01-00-5e-00-00-01     static
                        234.48.35.103         01-00-5e-30-23-67     static
                        239.192.152.143       01-00-5e-40-98-8f     static
                        239.255.255.250       01-00-5e-7f-ff-fa     static
                        255.255.255.255       ff-ff-ff-ff-ff-ff     static
                      
                      Interface: 169.254.54.84 --- 0x12
                        Internet Address      Physical Address      Type
                        169.254.255.255       ff-ff-ff-ff-ff-ff     static
                        224.0.0.2             01-00-5e-00-00-02     static
                        224.0.0.22            01-00-5e-00-00-16     static
                        224.0.0.251           01-00-5e-00-00-fb     static
                        224.0.0.252           01-00-5e-00-00-fc     static
                        230.0.0.1             01-00-5e-00-00-01     static
                        234.48.35.103         01-00-5e-30-23-67     static
                        239.192.152.143       01-00-5e-40-98-8f     static
                        239.255.255.250       01-00-5e-7f-ff-fa     static
                        255.255.255.255       ff-ff-ff-ff-ff-ff     static
                      
                      c:\>
                      

                      My pfsense runs on a ESXi host as a VM. And the MAC is 00-50-56-9a-31-cd, which seems correct.

                      LAN.Mac.png

                      I have never tried Wireshark before and I will post the log as soon as I can.

                      1 Reply Last reply Reply Quote 0
                      • S
                        shawn8888
                        last edited by shawn8888

                        Here is some log from Wireshark when I did a

                        c:\>nslookup www.facebook.com
                        Server:  UnKnown
                        Address:  192.168.100.2
                        
                        Non-authoritative answer:
                        Name:    star-mini.c10r.facebook.com
                        Addresses:  2a03:2880:f105:83:face:b00c:0:25de
                                  157.240.12.35
                        Aliases:  www.facebook.com
                        
                        

                        mydns.zip

                        From the log, I can read that my Windows (100.100) DID talk to pfsense (100.2), but not handled by unbound.

                        One more thing to mention, I did install BIND for some testing before, but it is disabled, same with DNS forwarder. Only DNS Resolver is enabled right now.

                        1 Reply Last reply Reply Quote 0
                        • KOMK
                          KOM
                          last edited by

                          OK, you're definitely talking to pfsense for DNS. You queried it for www.facebook.com and it returned a result for both IPv4 and IPv6. Did you add the host override for www.facebook.com?

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            shawn8888 @KOM
                            last edited by shawn8888

                            @KOM
                            Yes!
                            dns1.png

                            And for testing and fun, I disabled DNS resolver and run nslookup in Windows, and still able to resolve. Does that make any sense?

                            c:\>ipconfig /flushdns
                            
                            Windows IP Configuration
                            
                            Successfully flushed the DNS Resolver Cache.
                            
                            c:\>nslookup www.facebook.com
                            Server:  UnKnown
                            Address:  192.168.100.2
                            
                            Non-authoritative answer:
                            Name:    star-mini.c10r.facebook.com
                            Addresses:  2a03:2880:f10e:83:face:b00c:0:25de
                                      157.240.14.35
                            Aliases:  www.facebook.com
                            
                            1 Reply Last reply Reply Quote 0
                            • johnpozJ
                              johnpoz LAYER 8 Global Moderator
                              last edited by johnpoz

                              So you have something else listening on 53 on pfsense then and not unbound..

                              lets see what is listening on 53

                              [2.4.4-RELEASE][admin@sg4860.local.lan]/: sockstat | grep :53
                              unbound  unbound    42007 3  udp4   192.168.3.253:53      *:*
                              unbound  unbound    42007 4  tcp4   192.168.3.253:53      *:*
                              unbound  unbound    42007 5  udp6   2001:470:snipped:3::253:53 *:*
                              unbound  unbound    42007 6  tcp6   2001:470:snipped:3::253:53 *:*
                              unbound  unbound    42007 7  udp4   192.168.9.253:53      *:*
                              unbound  unbound    42007 8  tcp4   192.168.9.253:53      *:*
                              unbound  unbound    42007 9  udp4   192.168.2.253:53      *:*
                              unbound  unbound    42007 10 tcp4   192.168.2.253:53      *:*
                              unbound  unbound    42007 11 udp4   192.168.6.253:53      *:*
                              unbound  unbound    42007 14 tcp4   192.168.6.253:53      *:*
                              unbound  unbound    42007 15 udp4   192.168.4.253:53      *:*
                              unbound  unbound    42007 16 tcp4   192.168.4.253:53      *:*
                              unbound  unbound    42007 17 udp4   192.168.7.253:53      *:*
                              unbound  unbound    42007 18 tcp4   192.168.7.253:53      *:*
                              unbound  unbound    42007 19 udp4   127.0.0.1:53          *:*
                              unbound  unbound    42007 20 tcp4   127.0.0.1:53          *:*
                              unbound  unbound    42007 21 udp6   ::1:53                *:*
                              unbound  unbound    42007 22 tcp6   ::1:53                *:*
                              [2.4.4-RELEASE][admin@sg4860.local.lan]/: 
                              

                              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

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                shawn8888 @johnpoz
                                last edited by shawn8888

                                @johnpoz said in DNS Resolver Host Override not working in Windows:

                                sockstat | grep :53

                                You are right. seems BIND is running.
                                dns2.png

                                But I checked the settings and it's disabled.
                                dns3.png

                                And what is this "named"???

                                dns4.png

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

                                  named is BIND

                                  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
                                  • S
                                    shawn8888
                                    last edited by shawn8888

                                    Thank you so much, johnpoz!

                                    I manually stopped the service at Status/Services screen. And this is what I got:

                                    c:\>nslookup www.facebook.com
                                    Server:  pfSense.mydomain.com
                                    Address:  192.168.100.2
                                    
                                    Name:    www.facebook.com
                                    Address:  192.168.100.201
                                    
                                    
                                    c:\>nslookup 192.168.100.201
                                    Server:  pfSense.mydomain.com
                                    Address:  192.168.100.2
                                    
                                    Name:    www.facebook.com
                                    Address:  192.168.100.201
                                    
                                    

                                    Still have questions though:

                                    1. As the screenshot shows, BIND is NOT enabled. How did this service get started?

                                    2. I haven't touched BIND for a long time. But I did restart pfsense for testing, which means the named service get auto started when reboot. How can I stop it?

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

                                      No idea... Seems like you config is borked.. Export your config and look at the xml.. If not enable it shouldn't be starting - unless you manually did something like installed bind on your own vs packages, etc.

                                      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

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        shawn8888 @johnpoz
                                        last edited by shawn8888

                                        @johnpoz said in DNS Resolver Host Override not working in Windows:

                                        No idea... Seems like you config is borked.. Export your config and look at the xml.. If not enable it shouldn't be starting - unless you manually did something like installed bind on your own vs packages, etc.

                                        I installed BIND from package. I guess I will have to uninstall it later.
                                        Thank you again for your help! You are amazing!

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

                                          Did you maybe click on the service and start it that way? I have the package installed because time need to play with it to help users.

                                          It doesn't auto start itself..

                                          Learned one thing for sure - check earlier what is actually run if other users have sim issue ;) Would of solved your problem like in step one vs just trusting that all you had running was unbound.

                                          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

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            shawn8888 @johnpoz
                                            last edited by

                                            @johnpoz
                                            No I didn't start the service manually.
                                            Very weird, isn't it? I would think only one service can be started on one port, 53. Maybe it's a bug of pfsense? LOL

                                            One last question:
                                            DNS forwarder, DNS resolver and BIND all do the same thing and only one should be enabled, correct?

                                            Is DNS resolver the best in your opinion?

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