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

    Is it possible to query domain name using outside DNS if using split DNS with Unbound?

    Scheduled Pinned Locked Moved DHCP and DNS
    16 Posts 4 Posters 787 Views 3 Watching
    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 Offline
      johnpoz LAYER 8 Global Moderator
      last edited by johnpoz

      Ok got your PM.. with your domain.. And don't show anything wrong with it on the public side. Other than cloudflare likes to use invalid serial numbers for their SOA ;)

      Maybe your not understanding me.. Pfsense has nothing to do with you talking to some IP out on the public, be it dns, be it http/https, ssh, sftp, ntp, whatever..

      Unless you blocked it - any client on your network would be able to talk directly to any dns server on the planet.

      If your not able to do a query for your domain for any sort of record directly to say goggle or quad9.. Then either you blocked it in pfsense, or its blocked upstream, or your intercepting traffic dns and sending it local? Which would explain how your getting your local records when your suppose to be asking some external NS.

      Your dig @8.8.8.8 would be direct to that IP and whatever you query you query..

      Here I setup a host override for www.cnn.com to point to 10.11.12.13

      override.png

      If I query that locally - that is what I get.

      C:\>dig www.cnn.com
      
      ; <<>> DiG 9.16.8 <<>> www.cnn.com
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7685
      ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
      
      ;; OPT PSEUDOSECTION:
      ; EDNS: version: 0, flags:; udp: 4096
      ;; QUESTION SECTION:
      ;www.cnn.com.                   IN      A
      
      ;; ANSWER SECTION:
      www.cnn.com.            3600    IN      A       10.11.12.13
      
      ;; Query time: 6 msec
      ;; SERVER: 192.168.3.10#53(192.168.3.10)
      ;; WHEN: Tue Nov 10 07:14:49 Central Standard Time 2020
      ;; MSG SIZE  rcvd: 56
      

      If I query say 8.8.8.8 I get the public..

      C:\>dig @8.8.8.8 www.cnn.com
      
      ; <<>> DiG 9.16.8 <<>> @8.8.8.8 www.cnn.com
      ; (1 server found)
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14646
      ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
      
      ;; OPT PSEUDOSECTION:
      ; EDNS: version: 0, flags:; udp: 512
      ;; QUESTION SECTION:
      ;www.cnn.com.                   IN      A
      
      ;; ANSWER SECTION:
      www.cnn.com.            147     IN      CNAME   turner-tls.map.fastly.net.
      turner-tls.map.fastly.net. 29   IN      A       151.101.1.67
      turner-tls.map.fastly.net. 29   IN      A       151.101.65.67
      turner-tls.map.fastly.net. 29   IN      A       151.101.129.67
      turner-tls.map.fastly.net. 29   IN      A       151.101.193.67
      
      ;; Query time: 32 msec
      ;; SERVER: 8.8.8.8#53(8.8.8.8)
      ;; WHEN: Tue Nov 10 07:15:50 Central Standard Time 2020
      ;; MSG SIZE  rcvd: 143
      

      If your trying to so something that would query unbound.. ie pfsense for that - then yeah you would be back your local host override. If your domain is set as pfsense domain, and you have your zone set as static then looking for something that you don't have a local record for would not look up from public. But the default setting is transparent.. And even if you had a local record for a, but not for soa.. you would be able to look that up as well as long as the domain is not your local zone.

      example - here I can query cnn.com for their soa.

      C:\>dig cnn.com soa
      
      ; <<>> DiG 9.16.8 <<>> cnn.com soa
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7664
      ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
      
      ;; OPT PSEUDOSECTION:
      ; EDNS: version: 0, flags:; udp: 4096
      ;; QUESTION SECTION:
      ;cnn.com.                       IN      SOA
      
      ;; ANSWER SECTION:
      cnn.com.                3600    IN      SOA     ns-47.awsdns-05.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
      
      ;; Query time: 53 msec
      ;; SERVER: 192.168.3.10#53(192.168.3.10)
      ;; WHEN: Tue Nov 10 07:19:11 Central Standard Time 2020
      ;; MSG SIZE  rcvd: 113
      

      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 25.07 | Lab VMs 2.8, 25.07

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

        @johnpoz

        I tried replying to your thread but my post was flagged as spam... what give??

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

          No idea what you were trying to post?

          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 25.07 | Lab VMs 2.8, 25.07

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

            @johnpoz

            Ok basically I had everything typed out and formatted but that was flagged as spam.

            I created the experiment you had above with the cnn override.

            ***Due to spam filter on these forums I can't type the actual www address below so to bypass spam filter --- c/n/n=cnn -- sorry about confusion.

            In both cases of query (dig www.c/n/n.com and dig @8.8.8.8 www.c/n/n.com) it resolved to the local IP address assigned in the override.

            I've tested this from multiple servers running in different VM's on the LAN and its the same for all.

            You stated something about dns interception however this has to be at the pfsense level since anything upstream to this would not resolve to the host override. Is there anywhere else in pfsense where the dns would be getting intercepted? I don't have any firewall rules for port 53 in any of the rulesets. I'm really confused.

            I've also ran the same queries above directly within pfsense -- the queries actually resolve correctly as per your example.

            1 Reply Last reply Reply Quote 0
            • bingo600B Offline
              bingo600 @kevdog
              last edited by

              @kevdog said in Is it possible to query domain name using outside DNS if using split DNS with Unbound?:

              @johnpoz

              I tried replying to your thread but my post was flagged as spam... what give??

              Could that be reputation < 5 ?

              /Bingo

              If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

              pfSense+ 23.05.1 (ZFS)

              QOTOM-Q355G4 Quad Lan.
              CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
              LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

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

                pfsense does not do dns redirection unless you specifically set it up.

                https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html

                What do you have in front of pfsense? Some soho router doing redirection pointing to pfsense for dns? Are you connected wireless to some wifi router behind pfsense, doing redirection?

                Or wired to some soho router doing it?

                This isn't rocket since - pfsense run a dns server. Unbound out of the box.. If you create a record locally for www.domain.tld that pints to 192.168.1.100 or something - nothing else would resolve that unless pfsense is asked for that.. If your resolving local IP, then someone you asked pfsense.. How you have your network setup I do not know..

                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 25.07 | Lab VMs 2.8, 25.07

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

                  @johnpoz

                  Hey thanks for at least pointing things out to me -- I really appreciate it since it really made me examine my setup a lot closer.

                  To answer your question directly I have a comcast model that plugs directly into self-built "protectli-type" box. pfsense is virtualized within xcp-ng which works pretty well for home setup.

                  I think however I found the problem after scratching my head for a really long long time. Within pfsense System->Advanced->Firewall & NAT -> Network Address Translation

                  NAT reflection mode for port fowards was set to Pure NAT. After disabling this setting, the queries would resolved appropriately. Strange I didn't think about this before.

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

                    Nat reflection has nothing to do with dns..

                    Nat reflection would be if you hit your wan IP on port X, and you had a port forward setup to forward port X to ip 192.168.1.100

                    That has zero to do with how dns would respond if you ask pfsense or not.. Again if you were doing a directed query to 8.8.8.8, pfsense would have zero to do with that conversation, nor would nat reflection.

                    Unless you had some port forward setup for dns (tcp/upd 53)??

                    Did you setup port forwarding for dns? Or redirection of dns?

                    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 25.07 | Lab VMs 2.8, 25.07

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

                      @johnpoz

                      Bubble burst

                      Screen Shot 2020-11-10 at 1.05.29 PM.png

                      I'm assuming this is the culprit right here as you suspected

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

                        Why would you setup a rule like that - makes zero sense.. For starter why would anything be hitting your wan but not to any of your firewall IPs?

                        For the life of me - can not figure out what that rule would do.. There should be nothing hitting your wan on 53, but not directed to your wan IP.. What are you wan firewall rules?

                        But yes if some traffic came into your wan interface for say 8.8.8.8 (not a firewall IP) it would be forwarded to loopback.. If your wan firewall rules allowed it, or some floating rule did. And then yes that would return whatever host override you had setup. 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 25.07 | Lab VMs 2.8, 25.07

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

                          @johnpoz

                          Yea - I get it. They don't make much sense -- I've definitely had to either drop some of the NAT and Firewall rules for not making sense. Bottom line was the NAT rules was redirecting all port 53 requests to pfsense which was intercepting all the outgoing traffic.

                          Thanks a lot for your help on this issue.

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