asn: map hosts to their corresponding ASN via WHOIS usage: asn.py [-h] [--host HOST] [--port PORT] [--update] [--populate] optional arguments: -h, --help show this help message and exit --host HOST IP address to listen on --port PORT Port to listen on --update Update dataset submodule and create/populate cache --populate Create and populate cache from current dataset INSTALL $ git submodule init $ git submodule update --recursive --remote $ doas apk add py3-gitpython (Alpine) $ ./asn.py --populate $ ./asn.py --host 0.0.0.0 --port 4343 optional: forward traffic destined for port 43 (WHOIS default) back to 4343 $ iptables -A PREROUTING -t nat -p tcp --dport 43 -j REDIRECT --to-ports 4343 USAGE $ whois -h whois.jordan.im 1.1.1.1 IP Address | AS Number | Country | AS Name | Announcement -----------+-----------+---------+---------------+------------- 1.1.1.1 | 13335 | AU | CLOUDFLARENET | 1.1.1.0/24 $ whois -h whois.jordan.im jordan.im IP Address | AS Number | Country | AS Name | Announcement ------------------+-----------+---------+-------------------+--------------- 185.73.44.145 | 8943 | GB | Jump Networks Ltd | 185.73.44.0/22 2001:ba8:0:4031:: | 8943 | GB | Jump Networks Ltd | 2001:ba8::/32