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

    DNS resolution for some hosts fails, but nslookup works

    Scheduled Pinned Locked Moved DHCP and DNS
    dns
    27 Posts 5 Posters 6.2k 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 @Klinger
      last edited by

      @klinger said in DNS resolution for some hosts fails, but nslookup works:

      The only NS that is configured is our central firewall.

      This is another pfsense box or something else?

      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

      K 1 Reply Last reply Reply Quote 0
      • K
        Klinger @johnpoz
        last edited by

        @johnpoz Our central firewall is a Sophos SG.

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

          Today I tested several settings and found the solution. As mentioned in the previous post, the solution:

          @johnpoz said in DNS resolution for some hosts fails, but nslookup works:

          Ok - if that is the case unbound would not resolve something that returns a rfc1918 address because of rebind protection. You would either need to turn that off completely, or set this domain as private, so that some A record that returns rfc1918 would be allowed
          https://docs.netgate.com/pfsense/en/latest/services/dns/rebinding.html

          is correct. It didn't work for me however because in my DNS Resolver config (Services -> DNS Resolver -> General Settings) the "DNS Query Forwarding" option was unchecked. After enabling that the solution worked. I can't tell if thats intended or not because it's not mentioned in the Docs. But at least it works for now.

          I tested with disabling rebind check completely and also tested if only setting a specified domain as private. Both options worked when query forwarding was enabled.

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

            @klinger said in DNS resolution for some hosts fails, but nslookup works:

            the "DNS Query Forwarding" option was unchecked

            I really don't know how you expected to resolve some secret rfc1918 address that only resolves via mpls network if you were not forwarding to this specific NS that had those records.

            I mean it would be possible to setup public dns and have some view, that only if you were hitting it from a specific IP(s) would you get the view that had the rfc1918 address in them.

            Glad you got it sorted.

            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

            S K 2 Replies Last reply Reply Quote 0
            • S
              SteveITS Galactic Empire @johnpoz
              last edited by

              @johnpoz said in DNS resolution for some hosts fails, but nslookup works:

              possible to setup public dns and have some view, that only if you were hitting it from a specific IP(s) would you get the view that had the rfc1918 address

              For sake of discussion we have private IPs set up under a subdomain in use on our data center. Virtuozzo needed the hostnames but we wanted to use private IPs for that layer. Maybe we could have set it all up on pfSense, but in normal DNS we can resolve them from our office too. Meh, multiple solutions. :)

              Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
              When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
              Upvote 👍 helpful posts!

              1 Reply Last reply Reply Quote 0
              • K
                Klinger @johnpoz
                last edited by

                @johnpoz Well it worked before... But I kinda misunderstood the option. I could also confirm that without forwarding mode, the pfSense firewall queried our central firewall for name resolution (via packet capture). So either way the "correct" name server was queried. 🤷

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

                  @klinger said in DNS resolution for some hosts fails, but nslookup works:

                  the pfSense firewall queried our central firewall for name resolution (via packet capture).

                  Well then you were forwarding - or that NS is authoritative for the domain you were looking up. Out of the box pfsense is a resolver, it talks to the roots down to talk to the actual NS for whatever domain your looking for.

                  So no out of the box pfsense would not query some NS on your network.. Unless the roots and the gltd servers pointed you to them..

                  Out of the box pfsense is a resolver..

                  Hey roots, what is the NS for .com

                  Hey gltd servers what is the NS for domain.com

                  Hey NS for domain.com what is the IP address of www.domain.com

                  you can see this with a simple dig and a +trace, this is how a resolver works.. So why would it ask some upstream NS in your network?

                  [23.01-RELEASE][admin@sg4860.local.lan]/root: dig www.netgate.com +trace
                  
                  ; <<>> DiG 9.18.8 <<>> www.netgate.com +trace
                  ;; global options: +cmd
                  .                       21987   IN      NS      d.root-servers.net.
                  .                       21987   IN      NS      e.root-servers.net.
                  .                       21987   IN      NS      f.root-servers.net.
                  .                       21987   IN      NS      g.root-servers.net.
                  .                       21987   IN      NS      h.root-servers.net.
                  .                       21987   IN      NS      i.root-servers.net.
                  .                       21987   IN      NS      j.root-servers.net.
                  .                       21987   IN      NS      k.root-servers.net.
                  .                       21987   IN      NS      l.root-servers.net.
                  .                       21987   IN      NS      m.root-servers.net.
                  .                       21987   IN      NS      a.root-servers.net.
                  .                       21987   IN      NS      b.root-servers.net.
                  .                       21987   IN      NS      c.root-servers.net.
                  .                       21987   IN      RRSIG   NS 8 0 518400 20230322050000 20230309040000 951 . TN/9VuM2Q8uI9vNqRDfX/si09GNyq8dHFQdBJPG7CE935u/HbanonU99 Z/mZRM2xIt9zJd8kuvWDi9t0TTLYdFaoJ4XMcQyOQZeeZM/XfLUNBkX0 YdJqjDZD3joFSHNUpKHRF/aIZhoKwRxuAqQsiK04HXrKt3SyaGnVsUy5 kXQU05Z5HEgP8ZK3ziqLD+0bRX9uYAegL+JgEEDx421apR1xN4FY6ngF VONOKheKbl6LhSp91jfkR5LhiEyAT3PMXwfQEntHAmCyBgfw05rbSZB6 vALXQDZBcWCs/pW9VEpPx4J1DpGYhgKAa7ojk8ZDgnY3kfl/H6LplGFi qme5AQ==
                  ;; Received 525 bytes from 127.0.0.1#53(127.0.0.1) in 0 ms
                  
                  com.                    172800  IN      NS      a.gtld-servers.net.
                  com.                    172800  IN      NS      b.gtld-servers.net.
                  com.                    172800  IN      NS      c.gtld-servers.net.
                  com.                    172800  IN      NS      d.gtld-servers.net.
                  com.                    172800  IN      NS      e.gtld-servers.net.
                  com.                    172800  IN      NS      f.gtld-servers.net.
                  com.                    172800  IN      NS      g.gtld-servers.net.
                  com.                    172800  IN      NS      h.gtld-servers.net.
                  com.                    172800  IN      NS      i.gtld-servers.net.
                  com.                    172800  IN      NS      j.gtld-servers.net.
                  com.                    172800  IN      NS      k.gtld-servers.net.
                  com.                    172800  IN      NS      l.gtld-servers.net.
                  com.                    172800  IN      NS      m.gtld-servers.net.
                  com.                    86400   IN      DS      30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766
                  com.                    86400   IN      RRSIG   DS 8 1 86400 20230323050000 20230310040000 951 . ENL8WPFbxOqXipIZr0gi73LXISv1Oc5VREINA+nwZ4SdXg72++HZvKPt q7Rlv/Zy/z8U0xsV8drSfktoc3L/vOT97I/xvBiqGBKfmcI9fZ+OI+rp aql8fl7ep0KxSsCW2snOapFvf3LeDcPop5OJtCOv0h0g6CYnLugbWdRR qiF6FDg38bx/QwpQZL0BKxD3E6/qjFOrBPuTbHkWk5P+B5SdEF9cWcsK pVy+N3wxKCvKALzxQzQ/zPja/P+8plxGzOYeiaZCFDN4wxa6433zkluG lLSTABiU6mnsmOl+0mVQWzsF0s6QgLemrtyQlGT9HJw/kZhsX8N7WnlJ sPBQ6w==
                  ;; Received 1175 bytes from 198.97.190.53#53(h.root-servers.net) in 33 ms
                  
                  netgate.com.            172800  IN      NS      ns1.netgate.com.
                  netgate.com.            172800  IN      NS      ns2.netgate.com.
                  CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 - CK0Q2D6NI4I7EQH8NA30NS61O48UL8G5 NS SOA RRSIG DNSKEY NSEC3PARAM
                  CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400 20230315042256 20230308041256 36739 com. VHsDr23lP03/xPxRbNUFC+UkSrUZ/Qr3JYHjhz7DYNOLPnzixRL+Hjv/ +kjbNiKVHYy2iGqU38XGJ4sPbvyRx8qygeTX3E7NnS4SdjnN2PKkTMAQ 42Vjxkq928qpoKPOwyn4zgcGSCZffTlNbY5IKVZacivEishoJ1j3BnVJ 1p2/N0gsLcS2GjIob2YGe7j4Lz8Aa5Rrj0s+DwlyP+BlCQ==
                  2U53SUOKS8OJJV178M90A8BMNI9USDVJ.com. 86400 IN NSEC3 1 1 0 - 2U54DC5VA9HQSV9DBV1IK3JD7KR4L61T NS DS RRSIG
                  2U53SUOKS8OJJV178M90A8BMNI9USDVJ.com. 86400 IN RRSIG NSEC3 8 2 86400 20230316045937 20230309044937 36739 com. JLAYnUTWdSkzhgKse8Qoyz0cdweJTibB9d0fQmTG1iDubISe0e/HhhBK SAdDEjqsOyV6x6bwtCVi+7HfoawJpsUgDNfYXEcgQfaXRk6TEOofhKnO mK+fVRHYsGbrBkyAfogu6KbQUAgleU65xfCmjKNaeYCDLe1Tq4FBcBLQ GstvOhDuAH5by0b1UBv+5k40jxuut/dlWfd+fxiwaxEO9A==
                  ;; Received 717 bytes from 2001:502:1ca1::30#53(e.gtld-servers.net) in 36 ms
                  
                  www.netgate.com.        60      IN      CNAME   1826203.group3.sites.hubspot.net.
                  ;; Received 124 bytes from 208.123.73.90#53(ns2.netgate.com) in 37 ms
                  
                  [23.01-RELEASE][admin@sg4860.local.lan]/root: 
                  

                  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
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.