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

    Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?

    Scheduled Pinned Locked Moved Firewalling
    54 Posts 10 Posters 2.8k 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.
    • A
      abesh @Raffi_
      last edited by

      @Raffi_ Hit me up if you decide to run this. I will share my optimized unbound config file with you :) You can just replace the existing unbound config and should be good to go :)

      1 Reply Last reply Reply Quote 1
      • V
        viragomann @abesh
        last edited by viragomann

        @abesh said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

        Already blocking in pihole.

        DoH (https) will not go to the pihole. It will go straight to the default gateway, which is pfSense, I guess.

        Edit:
        So you block the resolution of DoH hosts on the pihole?
        OK, but blocking it on pfSense would be more reliable, if a device goes to the IP directly.

        A 1 Reply Last reply Reply Quote 0
        • keyserK
          keyser Rebel Alliance @viragomann
          last edited by

          @viragomann It was hardcoded application IP endpoint I was reffering to - not hardcoded DNS. Aka: The APP on the device just contacts the IP directly - no DNS resolution beforehand.

          DoH is a game of Whack a Mole - as is DoT even though most of them can be blocked by blocking port 853.

          Unfortunately this is where everything is going (in the name of privacy - even though it is mostly used by vendors to make sure they have the revenue of selling your data rather than your ISP)

          Love the no fuss of using the official appliances :-)

          V 1 Reply Last reply Reply Quote 2
          • A
            abesh @viragomann
            last edited by

            @viragomann I think it will, if it needs to look up hostnames :) I have two lists (you can see one on the Rules screenshot). I block IPs of DoH servers in pfSense and block domains in piHole.

            1 Reply Last reply Reply Quote 0
            • V
              viragomann @keyser
              last edited by

              @keyser said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

              It was hardcoded application IP endpoint I was reffering to - not hardcoded DNS. Aka: The APP on the device just contacts the IP directly - no DNS resolution beforehand.

              Got it. There is not really much you can to on the DNS to prohibit this, if it's not used then.

              A 1 Reply Last reply Reply Quote 0
              • A
                abesh @viragomann
                last edited by

                @viragomann @disi1 @AndyRH @keyser So from debugging this a bit it seems that these might be showing up as "not using pihole" because maybe they send their DNS queries to pfSense which is then forwarded to pihole. Pihole thinks it is coming from pfSense and not the device itself. How do I configure pfSense so that it also send the device hostnames when forwarding the request ?

                Raffi_R V AndyRHA 3 Replies Last reply Reply Quote 0
                • Raffi_R
                  Raffi_ @abesh
                  last edited by Raffi_

                  @abesh said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

                  @viragomann @disi1 @AndyRH @keyser So from debugging this a bit it seems that these might be showing up as "not using pihole" because maybe they send their DNS queries to pfSense which is then forwarded to pihole. Pihole thinks it is coming from pfSense and not the device itself. How do I configure pfSense so that it also send the device hostnames when forwarding the request ?

                  This is beginning to sound like an Abbott and Costello sketch. I hope no one queried who's on first. Sorry bad joke.

                  Have you tried my original suggestion of allowing pfsense to run unbound and then point pi-hole to it?

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    abesh @Raffi_
                    last edited by

                    @Raffi_ That was actually the first setup that I ran and I moved on to this :)

                    Raffi_R 1 Reply Last reply Reply Quote 0
                    • Raffi_R
                      Raffi_ @abesh
                      last edited by Raffi_

                      @abesh And we're still talking about brown or red entries? I saw all brown on your screen shot.

                      And to be clear, you had the same exact issue with that original setup which prompted you to try something else or were you trying to address something else? In my experience there might be a couple of devices which do not use pi-hole. How many exactly are you noticing?

                      A 1 Reply Last reply Reply Quote 0
                      • A
                        abesh @Raffi_
                        last edited by

                        @Raffi_ Yeah, let me wait and observe a bit.

                        1 Reply Last reply Reply Quote 0
                        • V
                          viragomann @abesh
                          last edited by

                          @abesh said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

                          Pihole thinks it is coming from pfSense and not the device itself.

                          @Raffi_ said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

                          Have you tried my original suggestion of allowing pfsense to run unbound and then point pi-hole to it?

                          I don't expect, that this makes any difference on the pihole seeing requests coming from pfSense.(?)

                          @abesh
                          If you want to see the origin client IPs, you have put the pihole into a separated network segment on a different interface, so that you can get rid of the masquerading rule.

                          A 2 Replies Last reply Reply Quote 0
                          • A
                            abesh @viragomann
                            last edited by

                            @viragomann That makes a lot of sense. Thank you :)

                            1 Reply Last reply Reply Quote 0
                            • A
                              abesh @viragomann
                              last edited by

                              @viragomann Would I get anything else other than local domain name resolution for forwarded queries if I move the pihole to a different subnet ? If not I would just like to keep it as is :)

                              V 1 Reply Last reply Reply Quote 0
                              • V
                                viragomann @abesh
                                last edited by

                                @abesh
                                There is no benefit else, I can think of at the moment.

                                A 1 Reply Last reply Reply Quote 0
                                • A
                                  abesh @viragomann
                                  last edited by

                                  @viragomann Thank you so much !!!

                                  1 Reply Last reply Reply Quote 0
                                  • AndyRHA
                                    AndyRH @abesh
                                    last edited by

                                    @abesh said in Redirected all DNS to pihole using pfSense. Pihole still showing some hosts as not using the DNS ?:

                                    How do I configure pfSense so that it also send the device hostnames when forwarding the request ?

                                    It will never send the hostname. I was not able to figure out how to send the requesting IP. I do not think it is possible because pfSense is "proxying" the request. Even hosts requesting from wrong DNS servers on different subnets show up as pfSense.
                                    DoH is mostly blocked with pfBlocker and DoT is blocked by blocking 853. Not perfect.

                                    o||||o
                                    7100-1u

                                    A 1 Reply Last reply Reply Quote 0
                                    • A
                                      abesh @AndyRH
                                      last edited by

                                      @AndyRH Apparently possible in OPNSense so should also be possible in pfSense. I need to go through this post in detail when I have a bit of time : https://forum.opnsense.org/index.php?topic=34907.0

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

                                        @abesh not exactly sure what your seeing and what you expect..

                                        If I redirect dns queries to my pihole I see who did the query.

                                        dns.jpg

                                        My pc i9-win.home.arpa is 192.168.9.100

                                        client.jpg

                                        This works when your pihole is on a different network than your client.. If the client is on the same network as your pihole your most likely going to run into issues with answer coming from different IP than where the client sent the traffic. Unless you forward to loopback and have unbound query the pihole, this will look like it came from pfsense IP vs the client.

                                        You might be able to use

                                        send-client-subnet:

                                        In your unbound config.. But not sure if that has been enabled in the unbound on pfsense.. I would have to do some testing.

                                        Your best option if you want to forward direct to pihole, and see what source IP asked for something, is put your pihole on a different vlan than your clients.

                                        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
                                        • provelsP
                                          provels
                                          last edited by

                                          Likely not relevant, but I use Pihole as the LAN DNS and forward to pfSense where it also hits pfBlocker and Unbound (Resolver).

                                          Peder

                                          MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
                                          BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

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

                                            @provels that is the better way to do it if you ask me.. That is what I do as well.. Clients ask pihole, pihole asks unbound on pfsense, unbound resolves.

                                            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

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