BGP AS Number Lookup Tool
Most of you have used of nslookup, the popular Unix tool for querying Domain Name Service (DNS) servers. In a similar respect, I made aslookup, a Unix command network tool for resolving Border Gateway Protocol (BGP) Autonomous System Number (ASN) information via Team Cymru DNS zones. DNS since it is faster and more efficient.
There are websites that make this information available, Team Cymru the owners of the DNS zones that aslookup uses, has one here. But, this is not the same as the command line, dig and nslookup with cut it for some things, but with aslookup queries are much easier.
Download and Build
You can download and build
tar zxf aslookup.tgz cd aslookup/ make
Things to note, the code isn’t perfect, so if you find any bugs or have any issues don’t hesitate to leave a comment. The code makes use of functions in the library libresolv, which aslookup links against.
Clone, compile, and enjoy.
$ aslookup 22.214.171.124 15169 | 126.96.36.199/24 | US | arin |
From the ASN we can query extra information, in this example, it’s 15169.
$ aslookup as15169 15169 | US | arin | 2000-03-30 | GOOGLE - Google Inc., US
Another quick example, grabbing the peers of a specific ASN.
$ aslookup -p 188.8.131.52 209 1103 1239 2381 3257 6453 6461 | 184.108.40.206/24 | US | arin |
aslookup can also take input from a pipe as well, any script should be able to produce output to a pipe to this command, for example:
$ echo -n as15169 | aslookup 15169 | US | arin | 2000-03-30 | GOOGLE - Google Inc., US