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 90.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.
    • GertjanG
      Gertjan @pftdm007
      last edited by

      @pftdm007

      Your are using the correct IP addresses ? Like :

      23e1f1cc-1092-4c31-8157-dd4a7ea450a8-image.png

      When you change DNSBL settings :
      Do a force realod all for pfBlocker.
      Reset for every LAN device the local DNS cache.
      Windows will need a

      ipconfig /flushdns
      

      @pftdm007 said in Bypassing DNSBL for specific IPs:

      Sometimes it returns the 1x1 gif thingy, sometimes the webpage with "This website BLABLABLA has been blocked by the Network Administrator!"

      That what's left over from the DNSBL web server that wants to tell you a page has been blocked.
      To make a long story short : don't use the DNSBL web server, because (repeat after me) "it is impossible to redirect a https request".

      Select :

      8537ec77-60ad-4f88-884a-8f200fe09a7d-image.png

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

      P 1 Reply Last reply Reply Quote 0
      • M
        michmoor LAYER 8 Rebel Alliance @pftdm007
        last edited by michmoor

        @pftdm007 python mode is very iffy. I have found that using unbound custom dns options works way better to exclude hosts or networks from DNSBL where as python mode only allows /32 exclusions which isn’t very scalable at all. I would highly recommend that over python mode.

        Firewall: NetGate,Palo Alto-VM,Juniper SRX
        Routing: Juniper, Arista, Cisco
        Switching: Juniper, Arista, Cisco
        Wireless: Unifi, Aruba IAP
        JNCIP,CCNP Enterprise

        1 Reply Last reply Reply Quote 0
        • P
          pftdm007 @Gertjan
          last edited by

          @gertjan said in Bypassing DNSBL for specific IPs:

          Your are using the correct IP addresses ?

          Yes. Client assigned IP's from pfsense's DHCP server.

          @gertjan said in Bypassing DNSBL for specific IPs:

          When you change DNSBL settings :
          Do a force realod all for pfBlocker.
          Reset for every LAN device the local DNS cache.

          I do a force reload on ALL (pfb and DNSBL). I usually close all browsers on all machines and retry, I haven't reset the local DNS cache per-se but will try. I only use linux boxes.

          @gertjan said in Bypassing DNSBL for specific IPs:

          don't use the DNSBL web server, because (repeat after me) "it is impossible to redirect a https request".

          Okay I had No Global mode set and changed it to Null Block (logging). lets see if DNSBL is more stable and predictable.

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

            @gertjan

            Just following up on this -- (Thanks for your help!)

            The Python Group Policy action works for whitelisting any clients, per host address e.g. 192.168.1.100 that we do not want DNSBL to filter.

            However I have another problem, sort of in the same neighborhood.

            I am using GeoIP as well using a domain name white list alias (domain a/s lookup enabled) that I created called "domain_whitelist_v4"

            This is the alias URL in the fw:

            https://127.0.0.1:443/pfblockerng/pfblockerng.php?pfb=pfB_domain_whitelist_v4

            I'm trying to use the same GeoIP alias file " domain_whitelist_v4" in a DNSBL Group Feed source definition to not take action/block on.

            The URL I set of the DNSBL group feed source definition is https://127.0.0.1:443/pfblockerng/pfblockerng.php?pfb=pfB_domain_whitelist_v4.txt

            I have the action set to "Disabled" instead of Unbound.

            I figure that If I update the GeoIP alias "domain_whitelist_v4" section, that I do not have to then also update the DNSBL Whitelist section too since their (DNSBL & GeoIP) are both referencing the same domain name list (domain_whitelist_v4). Instead I have to update in 2 places for domain reachability sometimes depending if its also being blocked via GeoIP

            Ideally, I don't want to remove all filtering for some clients, but instead I'd like to update one alias file that covers both DNSBL (permit) and GeoIP (permit)

            1 Reply Last reply Reply Quote 0
            • provelsP provels referenced this topic on
            • JonathanLeeJ
              JonathanLee
              last edited by JonathanLee

              Is there a way to bypass just one url request so it always goes to 8.8.8.8 for example?

              imap.gmail.com for example keeps getting saved inside my cache I use strict destination for my outgoing smtp and imap ports everything works except gmail because it uses so many rotating ip addresses.

              91b7acb3-d942-4ed2-9410-3e2f1db07d1c-image.png

              I have an alias that only allows outbound mail to go to servers we use.

              Example outlook, gmail, yahoo, apple mail, and nothing else.

              8aac34ab-fb10-4491-bbe9-31a11e636dd2-image.png

              Maybe something like???

              server: 
                     access-control-view: imap.gmail.com bypass
              view:
                     name "bypass"
                     view-first: yes
                     forward-addr: 8.8.8.8@853????
              

              The goal is to never check the cache database for this address to just send it up stream so the authoritative server resolves it every time it is requested

              You remember a couple of years ago some government offices were hacked because they had any any for outbound mail ports? This is my solution to fix this but gmail makes it difficult it is the only one that you have to refresh to get it to connect in mail applications everything else is fine with timeouts, google must change ip addresses every min or less at times for gmail.

              Make sure to upvote

              M 1 Reply Last reply Reply Quote 0
              • M
                mcury Rebel Alliance @JonathanLee
                last edited by mcury

                @JonathanLee Try this:

                forward-zone:
                        name: "imap.gmail.com"
                        forward-addr: 8.8.8.8
                        forward-no-cache: yes
                

                Didn't test it, so not sure if its going to work.
                Got this info from the following link: https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html

                dead on arrival, nowhere to be found.

                JonathanLeeJ 1 Reply Last reply Reply Quote 1
                • JonathanLeeJ
                  JonathanLee @mcury
                  last edited by JonathanLee

                  @mcury said in Bypassing DNSBL for specific IPs:

                  forward-zone:
                  name: "imap.gmail.com"
                  forward-addr: 8.8.8.8
                  forward-no-cache: yes

                  Thanks, I appreciate your help this also did not work. It came back.

                  I am trying it like this now before server:

                  forward-zone:
                  name: "imap.gmail.com"
                  forward-addr: 8.8.8.8
                  forward-no-cache: yes
                  server:
                  do-ip4: yes
                  prefer-ip4: yes
                  do-ip6: no
                  prefer-ip6: no
                  private-address: ::/0
                  dns64-ignore-aaaa: *.*
                  do-not-query-address: ::
                  do-not-query-address: ::1
                  do-not-query-address: ::/0
                  
                  

                  I hope this works versus after server:

                  Make sure to upvote

                  1 Reply Last reply Reply Quote 0
                  • JonathanLeeJ
                    JonathanLee
                    last edited by JonathanLee

                    Screenshot 2025-01-17 at 12.44.41.png

                    That seemed to fix it so now the email system can only send out to gmail and google will tell devices what ip to use each time without it changing gmail was driving me crazy

                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.250.141.108
                    Name:	imap.gmail.com
                    Address: 142.250.141.109
                    
                    iMac:~ joanthanlee$ nslookup imap.gmail.com
                    Server:		192.168.1.1
                    Address:	192.168.1.1#53
                    
                    Non-authoritative answer:
                    Name:	imap.gmail.com
                    Address: 142.251.2.108
                    Name:	imap.gmail.com
                    Address: 142.251.2.109
                    

                    You can now see it change every time before it would cache it and resend it.

                    UPDATE: It still times out and shows errors like before, I wonder what the issue is with it having the old IP address weird right?

                    Make sure to upvote

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      mcury Rebel Alliance @JonathanLee
                      last edited by mcury

                      @JonathanLee said in Bypassing DNSBL for specific IPs:

                      UPDATE: It still times out and shows errors like before, I wonder what the issue is with it having the old IP address weird right?

                      So, as I see it, DNS is not caching anymore, however since you are using an alias with FQDNs, the firewall itself will cache those for 5 minutes (300 seconds).

                      https://docs.netgate.com/pfsense/en/latest/firewall/aliases.html

                      Instead of using this method (alias with FQDN), try creating a firewall rule just for imap.gmail.com using AS15169.

                      2f4bd9ce-50ce-4528-afa7-a8daf81e88d5-image.png

                      You can do it throuhg pfBlockerNG IP, not through DNSBL.

                      Edit: Another way would be to create an alias with all the IPs you were able to resolve using the nslookup above.

                      dead on arrival, nowhere to be found.

                      JonathanLeeJ 1 Reply Last reply Reply Quote 1
                      • JonathanLeeJ
                        JonathanLee @mcury
                        last edited by

                        @mcury thanks for the reply I will test this soon and yet you know how it works out.

                        Make sure to upvote

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