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

    TLD Domain count exceeded.

    Scheduled Pinned Locked Moved pfBlockerNG
    10 Posts 5 Posters 1.7k Views 5 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.
    • F Offline
      float
      last edited by

      Hello,

      I received the following message (pfsense 23.05.1-RELEASE):

      Assembling DNSBL database...... completed [ 08/1/23 21:09:09 ]
      TLD:
      TLD analysis........................................xxxxxxxxxxxxxxxxxxx completed [ 08/1/23 21:09:33 ]
      
        ** TLD Domain count exceeded. [ 4000000 ] All subsequent Domains listed as-is **
      
      TLD finalize...
       ----------------------------------------
       Original    Matches    Removed    Final     
       ----------------------------------------
       5800359     2956267    836484     4963875   
       -----------------------------------------
      TLD finalize... completed [ 08/1/23 21:10:13 ]
      

      It's not clear to me if I have to change anything. I read this topic: https://forum.netgate.com/topic/169369/how-to-increase-tld-domain-count-exceeded-4000000

      I checked out this php file and normally with 8 GB of memory the limit of 4000000 should not be applied, but rather a higher limit.

      if (!$pfb['dnsbl_py_blacklist']) {
      		$pfb['pfs_mem'] = array(   '0' => '100000', '1500' =>  '150000', '2000' =>  '200000', '2500' =>  '250000', '3000' =>  '400000',
      					'4000' => '600000', '5000' => '1000000', '6000' => '1500000', '7000' => '2000000', '8000' => '2500000',
      					'12000' => '3000000', '16000' => '4000000', '32000' => '8000000');
      	} else {
      		$pfb['pfs_mem'] = array(   '0' => '200000', '1500' =>  '300000', '2000' =>  '400000', '2500' =>  '500000', '3000' =>  '800000',
      					'4000' => '1200000', '5000' => '2000000', '6000' => '3000000', '7000' => '4000000', '8000' => '5000000',
      					'12000' => '6000000', '16000' => '8000000', '32000' => '16000000');
      	}
      

      Is this a bug?

      UnoptanioU 2 Replies Last reply Reply Quote 0
      • UnoptanioU Offline
        Unoptanio @float
        last edited by Unoptanio

        @float

        Hi, I have the same problem.
        Do you have any news? how to solve?

        a3e33f20-d83b-46f1-84ec-18a9823c5d89-image.png

        pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
        CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
        n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

        1 Reply Last reply Reply Quote 0
        • UnoptanioU Offline
          Unoptanio @float
          last edited by

          @float

          ????

          65311919-10a8-4eb0-b040-c1ae188371b1-image.png

          pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
          CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
          n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

          F 1 Reply Last reply Reply Quote 0
          • F Offline
            float @Unoptanio
            last edited by

            @Unoptanio please check out https://www.reddit.com/r/pfBlockerNG/comments/15jpbmq/tld_domain_count_exceeded/

            UnoptanioU 1 Reply Last reply Reply Quote 1
            • UnoptanioU Offline
              Unoptanio @float
              last edited by Unoptanio

              @float

              Extract from /usr/local/pkg/pfblockerng/pfblockerng.inc

              // Determine max Domain count available for DNSBL TLD analysis (Avoid Unbound memory exhaustion)
              	$pfs_memory = (round(get_single_sysctl('hw.physmem') / (1024*1024)) ?: 1000);
              
              	if (!$pfb['dnsbl_py_blacklist']) {
              		$pfb['pfs_mem'] = array(   '0' => '100000', '1500' =>  '150000', '2000' =>  '200000', '2500' =>  '250000', '3000' =>  '400000',
              					'4000' => '600000', '5000' => '1000000', '6000' => '1500000', '7000' => '2000000', '8000' => '2500000',
              					'12000' => '3000000', '16000' => '4000000', '32000' => '8000000');
              	} else {
              		$pfb['pfs_mem'] = array(   '0' => '200000', '1500' =>  '300000', '2000' =>  '400000', '2500' =>  '500000', '3000' =>  '800000',
              					'4000' => '1200000', '5000' => '2000000', '6000' => '3000000', '7000' => '4000000', '8000' => '5000000',
              					'12000' => '6000000', '16000' => '8000000', '32000' => '16000000');
              	}
              
              	foreach ($pfb['pfs_mem'] as $pfb_mem => $domain_max) {
              		if ($pfs_memory >= $pfb_mem) {
              			$pfb['domain_max_cnt'] = $domain_max;
              		}
              	}
              

              change "'7000' => '2000000'" and "'7000' => '4000000'" to "'7000' => '6000000'" in both sets.

              change "'8000' => '2500000'" and "'8000' => '5000000'" to "'8000' => '6000000'" in both sets.

              Update Reload | DNSBL after making these changes.

              2e83ff06-6f9d-4627-a64d-71193a0c3608-image.png

              pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
              CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
              n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                Squuiid @Unoptanio
                last edited by

                @Unoptanio said in TLD Domain count exceeded.:

                @float

                Extract from /usr/local/pkg/pfblockerng/pfblockerng.inc

                // Determine max Domain count available for DNSBL TLD analysis (Avoid Unbound memory exhaustion)
                	$pfs_memory = (round(get_single_sysctl('hw.physmem') / (1024*1024)) ?: 1000);
                
                	if (!$pfb['dnsbl_py_blacklist']) {
                		$pfb['pfs_mem'] = array(   '0' => '100000', '1500' =>  '150000', '2000' =>  '200000', '2500' =>  '250000', '3000' =>  '400000',
                					'4000' => '600000', '5000' => '1000000', '6000' => '1500000', '7000' => '2000000', '8000' => '2500000',
                					'12000' => '3000000', '16000' => '4000000', '32000' => '8000000');
                	} else {
                		$pfb['pfs_mem'] = array(   '0' => '200000', '1500' =>  '300000', '2000' =>  '400000', '2500' =>  '500000', '3000' =>  '800000',
                					'4000' => '1200000', '5000' => '2000000', '6000' => '3000000', '7000' => '4000000', '8000' => '5000000',
                					'12000' => '6000000', '16000' => '8000000', '32000' => '16000000');
                	}
                
                	foreach ($pfb['pfs_mem'] as $pfb_mem => $domain_max) {
                		if ($pfs_memory >= $pfb_mem) {
                			$pfb['domain_max_cnt'] = $domain_max;
                		}
                	}
                

                change "'7000' => '2000000'" and "'7000' => '4000000'" to "'7000' => '6000000'" in both sets.

                change "'8000' => '2500000'" and "'8000' => '5000000'" to "'8000' => '6000000'" in both sets.

                Update Reload | DNSBL after making these changes.

                @BBcan177 I run a Netgate 6100 Max and unfortunately every pfBlockerNG update requires me to re-edit these values.
                Is there any chance these values could get increased more permanently? Or perhaps a UI option that allows tweaking the value according to a user's specific RAM utilisation rather than these rough estimates? I run pfBlockerNG, Snort, ZabbixAgent6 and Wireguard packages without breaking a sweat on this 6100 Max with 8GB. TLD count is:

                Original: 6786434
                Matches: 5001323
                Removed: 1184774
                Final: 5601660

                That said, if I'm way off here and doing something wrong please do set me straight!
                Thanks

                BBcan177B 1 Reply Last reply Reply Quote 1
                • BBcan177B Offline
                  BBcan177 Moderator @Squuiid
                  last edited by

                  @Squuiid do you use Python mode or Unbound mode? I will see. Thanks.

                  "Experience is something you don't get until just after you need it."

                  Website: http://pfBlockerNG.com
                  Twitter: @BBcan177  #pfBlockerNG
                  Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    Squuiid @BBcan177
                    last edited by

                    @BBcan177 Thanks for the quick reply! Python mode.

                    f852e2d9-846a-44da-b98a-bd03967ebac9-image.png

                    UnoptanioU 1 Reply Last reply Reply Quote 0
                    • UnoptanioU Offline
                      Unoptanio @Squuiid
                      last edited by Unoptanio

                      @Squuiid @BBcan177
                      Just me:
                      Unbound python mode

                      but:
                      I increased my system's RAM to 32GB

                      978225a9-c315-41c3-b214-b111040959ea-image.png

                      87fbc299-5850-4cde-b265-46f202a8a5f5-image.png

                      my values:

                      8ea18e9d-125d-4998-a4d0-00261300bf87-image.png

                      I increased my system's RAM to 32GB

                      e5069e5e-b473-4c91-b1e8-a2e3898316cb-image.png

                      pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                      CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                      n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                      tinfoilmattT 1 Reply Last reply Reply Quote 0
                      • tinfoilmattT Offline
                        tinfoilmatt @Unoptanio
                        last edited by

                        Resurrecting this thread for two reasons:

                        1.) Because this is where I landed when newly confronted with the topic using pfBlockerNG-devel 3.2.10 on pfSense CE 2.8.1-RELEASE; and
                        2.) to confirm that the 'issue' and 'fix' here continue to be viable despite the TLD analysis function being considerably modified since the last post in September 2024.

                        Current function @ L7255 of /usr/local/pkg/pfblockerng/pfblockerng.inc:

                        // Determine max Domain count available for DNSBL TLD analysis (Avoid Unbound memory exhaustion)
                                $pfs_memory = (round(get_single_sysctl('hw.physmem') / (1024*1024)) ?: 1000);
                        
                                $pfb['pfs_mem'] = [
                                        '0' => '100000',
                                        '1500' => '150000',
                                        '2000' => '200000',
                                        '2500' => '250000',
                                        '3000' => '400000',
                                        '4000' => '600000',
                                        '5000' => '1000000',
                                        '6000' => '1500000',
                                        '7000' => '2000000',
                                        '8000' => '2500000',
                                        '12000' => '3000000',
                                        '16000' => '4000000',
                                        '32000' => '8000000'
                                ];
                        
                                if ($pfb['dnsbl_py_blacklist']) {
                                        array_walk($pfb['pfs_mem'], function (&$value) {
                                                $value = $value * 3;
                                        });
                                }
                        
                                foreach ($pfb['pfs_mem'] as $pfb_mem => $domain_max) {
                                        if ($pfs_memory >= $pfb_mem) {
                                                $pfb['domain_max_cnt'] = $domain_max;
                                        }
                                }
                        

                        On a system with 32 GB of RAM attempting to 'analyze' over 24M but less than 27M domains, the line "'32000' => '8000000'" was changed to "'32000' => '9000000'" (i.e., permitting a maximum number of 27M domains to be 'analyzed') in order for the function to complete successfully.

                        Analyzing (and then subsequently loading) precisely this number of domains...

                         Original    Matches    Removed    Final     
                         ----------------------------------------
                         24270656    21017552   6463516    17807140  
                         -----------------------------------------
                        

                        ...results in Unbound's stable operational consumption of ~6 GB of RAM and any/all pfBlockerNG 'Reload' options consuming as much as ~6 GB of RAM, concurrently. Therefore one should only attempt this DNSBL hack if they're confident that their system has at least 13 GB of memory 'headroom' (taking into account normal system operation and any other resource-consuming, installed packages).

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