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

    Bypassing DNSBL for specific IPs

    Scheduled Pinned Locked Moved pfBlockerNG
    114 Posts 28 Posters 87.0k 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.
    • G
      GodAtum @horse2370
      last edited by

      @horse2370 thanks I had a server:include: /var/unbound/pfb_dnsbl.*conf on the end!

      1 Reply Last reply Reply Quote 0
      • R
        Risfold
        last edited by

        Thank you to all who commented here. I didn't know views were possible in unbound until reviewing this post. I was working through implementing this in my use case which is different than others here. I wanted to comment and share in case anyone else has a similar issue.

        tldr: listing only networks for bypassing dnsbl, with defaulting to use of dnsbl for clients

        I have many networks (vpns, vlans, etc.), and wanted to configure the use of dnsbl as a default from any network except for specific clients or networks listed. In the examples above, each network has to be listed as either dnsbl or bypass. I didn't want to have to list all networks, and only list bypass IPs/networks since most will use dnsbl.

        The key I found to get this working was to set

        view-first: no
        

        This wasn't entirely clear to me from the unbound documentation, but seems to work as ignoring the default settings.

        I also tried entering a view network such below, to cover all possible private IPs. But these didn't work:

        access-control-view: 172.16.0.0/12 bypass_dnsbl
        access-control-view: 192.168.0.0/16 bypass_dnsbl
        

        My working config is here:

        server:
        include: /var/unbound/pfb_dnsbl.*conf
        access-control-view: 172.20.0.0/24 bypass_dnsbl #guest vlan
        view:
            name: "bypass_dnsbl"
            view-first: no
            include: /var/unbound/host_entries.conf #Host overrides AND DHCP reservations
            include: /var/unbound/dhcpleases_entries.conf #DHCP leases
        

        I think this would also have the added benefit of pfblocker not re-adding the "include:" config, but not entirely sure since I have only added recently. If anyone notices an issue with this, please let me know! 😜

        1 Reply Last reply Reply Quote 1
        • F
          fabioccoelho LAYER 8
          last edited by

          Hello everyone, is there a possibility to allow a particular host or network to access a certain category of dnsbl? Example: IP 192.168.0.1 access the social networks category and continue with the rest blocked?

          Thanks.

          R 1 Reply Last reply Reply Quote 0
          • R
            Risfold @fabioccoelho
            last edited by

            @fabioccoelho said in Bypassing DNSBL for specific IPs:

            Hello everyone, is there a possibility to allow a particular host or network to access a certain category of dnsbl? Example: IP 192.168.0.1 access the social networks category and continue with the rest blocked?

            Thanks.

            Looks like its being worked on, good timing.
            https://www.reddit.com/r/pfBlockerNG/comments/kdg5wq/preliminary_dnsbl_group_policy/

            Without these upcoming features, what you want to do would be pretty complicated. I have previously set up different pfsense/pfblocker instances to to accomplish this.

            F 1 Reply Last reply Reply Quote 2
            • F
              fabioccoelho LAYER 8 @Risfold
              last edited by

              @risfold Thanks a lot :-)

              1 Reply Last reply Reply Quote 1
              • S
                SmokinMoJoe @Ns8h
                last edited by

                This thread started in 2018 and has comments up to the end of 2020.

                Do we have an option in the gui to allow one or more ip addresses or hosts to do unblocked DNS?

                What I am looking for is something in the GUI that is stable and will stay when doing upgrades. Command line tricks and extra config files are not what I am asking for.

                Thanks,
                Joe

                GertjanG 1 Reply Last reply Reply Quote 2
                • GertjanG
                  Gertjan @SmokinMoJoe
                  last edited by

                  @smokinmojoe

                  On the Firewall > pfBlockerNG > DNSBL page :

                  5f08eb3e-5d96-4dc2-aef5-b1bc2588d184-image.png cf2a222d-a2d8-4194-9c16-f16eb8866105-image.png

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  G O 2 Replies Last reply Reply Quote 4
                  • G
                    GodAtum @Gertjan
                    last edited by

                    @gertjan I'm not getting that on the page. Using v3.0.0_16 on pfsense 2.5.1

                    K 1 Reply Last reply Reply Quote 0
                    • K
                      kezzla @GodAtum
                      last edited by

                      @godatum Check the reddit link posted above, there is a tip that says to switch to python mode for the option to become available:

                      Preliminary DNSBL Group Policy : pfBlockerNG
                      https://www.reddit.com/r/pfBlockerNG/comments/kdg5wq/preliminary_dnsbl_group_policy/

                      GertjanG 1 Reply Last reply Reply Quote 1
                      • GertjanG
                        Gertjan @kezzla
                        last edited by

                        Yep, this box should be checked :

                        d1778b64-3485-4e55-a19a-7a4844c344aa-image.png

                        No "help me" PM's please. Use the forum, the community will thank you.
                        Edit : and where are the logs ??

                        S 1 Reply Last reply Reply Quote 1
                        • T
                          turbotater19
                          last edited by turbotater19

                          Here from Reddit, then Mayfield IT...
                          I've got a setup where I'd like to bypass pfBlockerNG for one single entire interface but keep it enabled for my other 2 interfaces. Interfaces "LAN1" (10.0.0.0 /24) and "Crapwork" (192.168.0.0 /24) should still get the full pfBlockerNG treatment (DNSBL+IPBL) while the unlucky guests on interface "BARN" (172.16.0.0 /24) won't and will have to see ads and get random IPs from bad places poking around!

                          Would I need to enter the below into the "custom options" box in DNS resolver settings and then also make sure interface "BARN" is not selected (while LAN1 and Crapwork are) in the "Outbound Firewall Rules" section of IP tab under pfBlockerNG?

                          server:
                              access-control-view: 172.16.0.0/24 bypass
                              access-control-view: 10.0.0.0/24 dnsbl
                              access-control-view: 192.168.0.0/24 dnsbl
                          view:
                              name: "bypass"
                              view-first: yes
                          view:
                              name: "dnsbl"
                              view-first: yes
                              include: /var/unbound/pfb_dnsbl.*conf
                          

                          Or should I update pfSense (on 2.4.5 yikes) and then update pfBlockerNG (on 2.2.5_30) and use the Bypass IPs field where I'd put (presumably) 172.16.0.0/24 and then same as above for IPBL settings?

                          GertjanG 1 Reply Last reply Reply Quote 1
                          • GertjanG
                            Gertjan @turbotater19
                            last edited by

                            @turbotater19 said in Bypassing DNSBL for specific IPs:

                            Or should I update pfSense (on 2.4.5 yikes)

                            Back then, as for as I can remember, you had to enter the custom unbound parameters (like you showed - can't tell if they are correct, though).

                            The latest pfSense, and the latest pfBlockerNG makes it possible to exclude IP (or even networks ?) using the pfBlockerNG GUI.
                            Select the (DNSBL) 'Python Group Policy' option and fill in the IP's.

                            No "help me" PM's please. Use the forum, the community will thank you.
                            Edit : and where are the logs ??

                            T 1 Reply Last reply Reply Quote 1
                            • T
                              turbotater19 @Gertjan
                              last edited by turbotater19

                              @gertjan said in Bypassing DNSBL for specific IPs:

                              Back then, as for as I can remember, you had to enter the custom unbound parameters (like you showed - can't tell if they are correct, though).

                              The latest pfSense, and the latest pfBlockerNG makes it possible to exclude IP (or even networks ?) using the pfBlockerNG GUI.
                              Select the (DNSBL) 'Python Group Policy' option and fill in the IP's.

                              Thanks for the reply. I guess then what I'm asking for is if anyone thinks my code is correct for keeping DNSBL active on 2 of my 3 interfaces while the one interface gets bypassed. All the examples I've seen appear to show a single IP bypassed while the rest are blocked or 2 VLANs.

                              Also, to implement this (provided I don't just update pfSense and then update pfBlockerNG), do I disable pfBlockerNG, add lines into custom options, save, then start pfBlockerNG? Or do I add this into custom options while pfBlockerNG is enabled?

                              1 Reply Last reply Reply Quote 1
                              • T
                                turbotater19
                                last edited by

                                I pasted my code in and initially it didn't work. Took out the leading spaces on each line and that fixed it, working as I'd hoped!

                                1 Reply Last reply Reply Quote 1
                                • O
                                  Overlord @Gertjan
                                  last edited by

                                  @gertjan
                                  I can't find it? Is it removed?

                                  I'm trying to find a solution to unblock an IP, which is one of my blocklist as false positive.

                                  GertjanG 1 Reply Last reply Reply Quote 0
                                  • GertjanG
                                    Gertjan @Overlord
                                    last edited by

                                    @overlord said in Bypassing DNSBL for specific IPs:

                                    I can't find it?

                                    Find what ?
                                    The initial - see above - is "how to bypass a specific IP".
                                    Reading the post shows that @Ns8h wanted to exclude a LAN device from being DNSBL'ed by pfBlocker - this was in 2018.

                                    Or do you man : You want to whitelist an IP ( or DNSBL ?) from a list/feed you use ?
                                    In that case, go to Firewall > pfBlockerNG > Alerts and look up the line where the IP was blocked. Example :

                                    d3516bfc-b8f8-46c1-a837-4d0b86ee487d-image.png

                                    if I want to unblock "8.8.8.8" blocked by the firewall rule pfB_DoH_IP_v4 (uses an alais that contains all the IPs from the TheGreatWall_DoH... DNDBL feed, I have to move the mouse to the red padlock, click and follow the instructions.
                                    This measure is temporary - as stated.

                                    Clicking on the black + sign is permanent :

                                    187c8caa-e1a3-4a08-bc9a-0da23e7e5d27-image.png

                                    Just follow the instructions.

                                    No "help me" PM's please. Use the forum, the community will thank you.
                                    Edit : and where are the logs ??

                                    O 1 Reply Last reply Reply Quote 0
                                    • S
                                      shon @Gertjan
                                      last edited by

                                      @gertjan said in Bypassing DNSBL for specific IPs:

                                      Yep, this box should be checked :

                                      d1778b64-3485-4e55-a19a-7a4844c344aa-image.png

                                      This did not work for me at all, and neither using custom unbound views. Not sure where else to look.

                                      GertjanG 1 Reply Last reply Reply Quote 0
                                      • GertjanG
                                        Gertjan @shon
                                        last edited by Gertjan

                                        @shon

                                        Just checking "Python Group Policy" does nothing.
                                        It's stated that "Enable the Python Group Policy functionality to allow certain Local LAN IPs to bypass DNSBL"

                                        So certain local IPs have to be entered.

                                        Like :

                                        cf606677-4183-4cf0-b0f3-c35003981277-image.png

                                        edit :

                                        I didn't have any DNSBIl activated, so I activated one.
                                        This one :

                                        80951f87-4c4d-4627-b119-1debf62b62ad-image.png

                                        Take a look at the feed text, and you find the last entry :
                                        avsvmcloud.com

                                        On my PC with the IP 192.168.1.2 (on the policy list - see my image above) I could obtain an IP :

                                        c1567ee7-b0e7-4b30-80c9-b3417a617ea0-image.png

                                        Or, on another PC using IP 192.168.1.9, I obtained "0.0.0.0" == DNSBL blocked ( I'm not using the build in pfBlockerNG web server, if I was, I would have received 10.10.10.1 ).

                                        My conclusion : Group policy works.

                                        I did not test IPv6 here. For IPv4 it worked.

                                        No "help me" PM's please. Use the forum, the community will thank you.
                                        Edit : and where are the logs ??

                                        S 2 Replies Last reply Reply Quote 0
                                        • S
                                          shon @Gertjan
                                          last edited by shon

                                          @gertjan I added my local IP4 addresses under the group policy as host IP's with no subnet mask range e.g. /32 /24 etc.. I restarted pfsense, unbound, ran , update force, reload and still no dice. I love the way it works but I need to whitelist IP's to get around pfblocker/dnsbl/geoip restrictions I've set already. thanks!

                                          1 Reply Last reply Reply Quote 0
                                          • O
                                            Overlord @Gertjan
                                            last edited by Overlord

                                            @gertjan
                                            As I can see there are no rules under "Deny". I have read there, that this issue could be from the installed version (2.1.4_26). Is this 2x version still in development? Is there a release date for the 3.x devel version? (Devel becomes non devel)

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