OP here. I was reading more about it and you can
actually (mostly) block entire companies such as
ads networks, Google, Facebook, Akamai, Yahoo,
etc, using their AS number.
For example, use this tool to find the corporation:
https://www.ultratools.com/tools/asnInfo
Then get their IP list (substitute the "asn=xxxxx"
for the actual number):
https://www.enjen.net/asn-blocklist/index.php?asn=xxxxx&type=iplist&api=1
Use the IP list on pf(4) to drop everything.
You can also block entire countries using RIR:
http://lite.ip2location.com/database-ip-country
http://dev.maxmind.com/geoip/geoip2/geolite2/
http://www.ipdeny.com/ipblocks/data/countries/
Countries like China and Russia usually have a
bad log on attacks, tracking, ads, etc.
For Unbound, I've found these:
https://github.com/firehol/blocklist-ipsets/
https://github.com/StevenBlack/hosts/
----------------------------------------------
P.S: Here's a list of ASN's you could want to block:
AS6432 - GOOGLE-FIBER - Google Fiber Inc., US
AS22577 - ADMOB-US - Google Inc., US
AS15169 - GOOGLE - Google Inc., US
AS36384 - GOOGLE-IT - Google Incorporated, US
AS36040 - YOUTUBE - Google Inc., US
AS36492 - GOOGLEWIFI - Google, Inc., US
AS41264 - GOOGLE-IT-RO-ISP, CH
AS45566 - GOOGLE-CORP-APAC-AS-AP AS number for Google Corporate Network
in APAC, IN
AS32934 - FACEBOOK - Facebook, Inc., US
AS23455 - AKAMAI-AS - Akamai Technologies, Inc., US
AS21342 - AKAMAI-ASN2, EU
AS16702 - AKAMAI-AS - Akamai Technologies, Inc., US
AS22207 - AKAMAI-AS - Akamai Technologies, Inc., US
AS31377 - AKAMAI-BOS, US
AS23903 - AKAMAI-AS-BANGLORE Akamai Banglore Office ASN, IN
AS21399 - AKAMAI3, US
AS20189 - AKAMAI-AS - Akamai Technologies, Inc., US
AS33905 - AKAMAI-AMS, EU
AS43639 - AKAMAI-AMS2, NL
AS31109 - AKAMAI-LA, EU
AS31110 - AKAMAI-SJC, EU
AS34850 - AKAMAI-MUC, IR
AS12222 - AKAMAI - Akamai Technologies, Inc., US
AS18680 - AKAMAI-AS - Akamai Technologies, Inc., US
AS35204 - AKAMAI-DUB, EU
AS39836 - AKAMAI-FRA, DE
AS35994 - AKAMAI-AS - Akamai Technologies, Inc., US
AS24319 - AKAMAI-TYO-AP Akamai Technologies Tokyo ASN, SG
AS23454 - AKAMAI-AS - Akamai Technologies, Inc., US
AS31108 - AKAMAI-VA, EU
AS34164 - AKAMAI-LON, GB
AS20940 - AKAMAI-ASN1, US
AS18717 - AKAMAI-AS - Akamai Technologies, Inc., US
AS35993 - AKAMAI-AS - Akamai Technologies, Inc., US
AS6182 - MICROSOFT-CORP-MSN-AS-4 - Microsoft Corporation, US
AS3598 - MICROSOFT-CORP-AS - Microsoft Corporation, US
AS8075 - MICROSOFT-CORP-MSN-AS-BLOCK - Microsoft Corporation, US
AS8072 - MICROSOFT-CORP-MSN-AS-BLOCK - Microsoft Corporation, US
AS8069 - MICROSOFT-CORP-MSN-AS-BLOCK - Microsoft Corporation, US
AS8068 - MICROSOFT-CORP-MSN-AS-BLOCK - Microsoft Corporation, US
AS13811 - MSLI - Microsoft Corporation, US
AS20046 - MICROSOFT-BOS - Microsoft Corporation, US
AS26222 - MS-DANGER - Microsoft Corporation, US
AS23468 - MICROSOFT-CORP-XBOX-ONLINE - Microsoft Corporation, US
AS7233 - YAHOO-US - Yahoo, US
AS5779 - YAHOO-DNB - Yahoo! Broadcast Services, Inc., US
AS7280 - YAHOO-FC - Yahoo! Inc., US
AS4694 - IDC Yahoo Japan Corporation, JP
AS2521 - IDC2521 Yahoo Japan Corporation, JP
AS2554 - IDC2554 Yahoo Japan Corporation, JP
AS7488 - IDC7488 Yahoo Japan Corporation, JP
AS55417 - YAHOO-SGA YAHOO! SGA, TW
AS40986 - YAHOO1-AS from AS28730 accept ANY, GB
AS22565 - YAHOO-NUQ - Yahoo, US
AS55517 - YAHOO-HKA YAHOO! HKA, HK
AS36752 - YAHOO-SP1 - Yahoo, US
AS36646 - YAHOO-NE1 - Yahoo, US
AS10310 - YAHOO-1 - Yahoo!, US
AS23816 - YAHOO Yahoo Japan Corporation, JP
AS34082 - YAHOO-AMA, GB
AS26101 - YAHOO-3 - Yahoo!, US
AS45915 - YAHOO-CORP-BWS-AS Yahoo! India Pvt Ltd., IN
AS45502 - YAHOO-CORP-MUMBAI-AP Yahoo Corp Network, KR
AS38689 - YHKR3-AS-KR KR3 Service Co,.Ltd., KR
AS24236 - YAHOO-BANGALORE-AS-AP Yahoo Bangalore Network Monitoring
Center, HK
AS34010 - YAHOO-IRD, GB
AS36088 - YAHOO-BCST-AC2 - Yahoo, US
AS45863 - YAHOO-CORP-NDI-AS Yahoo! India Pvt Ltd., IN
AS17110 - YAHOO-US2 - Yahoo, US
AS10880 - YAHOO-AN2 - Yahoo, US
AS36129 - YAHOO-MAVEN - Yahoo, US
AS24376 - YAHOO-CN2-AP Yahoo China Datacenter, CN
AS14678 - YAHOO-HILLSBORO - Yahoo, US
AS10157 - YAHOO-AS-KR Yahoo! Korea, Corp., KR
AS55416 - YAHOO-KRA YAHOO! KRA, KR
AS24018 - YAHOO-BACKBONE-AP Yahoo Backbone Network, Asia Pacific, HK
AS36229 - YAHOO-YSM-SC8 - Yahoo! Inc., US
AS45501 - YAHOO-CORP-SG-AS-AP Yahoo Corp Network, SG
AS38072 - YAHOO-IN2-AS Yahoo! Web Services India Pvt Ltd., IN
AS55418 - YAHOO-ID1 YAHOO! ID1, SG
AS15635 - YAHOO-UKL, GB
AS43428 - YAHOO-ULS, GB
AS42173 - YAHOO-SWITZERLAND, CH
AS36647 - YAHOO-GQ1 - Yahoo, US
AS15896 - YAHOO-DEA, DE
AS24572 - YAHOO-JP-AS-AP Yahoo Japan, JP
AS24506 - YAHOO-TP2 YAHOO! TAIWAN, TW
AS26085 - YAHOO-2 - Yahoo!, US
AS14196 - YAHOO-CHA - Yahoo, US
AS23926 - YAHOO-JP3-AP JP DC, JP
Thanks for sharing. Full of information. But here, one of your links for the ANS Lookup is not working. So it's better to replace it with that
ReplyDeleteDNSChecker ANS Lookup. It's helpful for the users.