Perhaps a better use of your time (because de-balkanization of the internet would be more of an academic exercise than a mass market reality; consumers have already self-selected into social media and crappy LLM outputs which is a far bigger matter and driver than ephemeral resources or reverse DNS) would be making your TLS work in a way that doesn't allow for easy abuse. So automatic redirects, HSTS, and a certificate that is standards-compliant.
Tangent, but last I checked, it was all the big tech giants pushing it down our throat. Unless it's your full time job to find loopholes and workarounds, there is no reasonable way for consumers to opt-out.
While it may seem more useful to aggregate the ranges in some points of view it'd be significantly less useful from other points of view. E.g. those who want to whitelist any IP ranges matching a specific DC, service, availability zone, or country.
You can always aggregate the detailed list but you can't do the inverse on your own.
[Edit] I think this might be where I found it [1]
#!/usr/bin/perl
use strict;
use warnings;
use Net::CIDR::Lite;
my $ipv4String='[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';
if(defined $ARGV[0] && $ARGV[0] eq '-h'){
print "usage: $0
This script summarizes your IP classes (if possible). Input IPs with mask one per line. End with CTRL+D. Optionally, redirect a file to stdin like so:
$0 < cidr.txt ";
exit;
}
print "Enter IP/Mask one per line (1.2.3.0/24). End with CTRL+D.\n";
my $cidr =Net::CIDR::Lite->new;
while(<>){
if(/($ipv4String\/[0-9]{1,2})/){
my $item=$1;
$cidr->add($item);
}
else{
print "Ignoring previous line.\n";
}
}
my @cidr_list = $cidr->list;
print "======Aggregated IP list:======\n";
foreach my $item(@cidr_list){
print "$item\n";
}
[1] - https://adrianpopagh.blogspot.com/2008/03/route-summarizatio...