BGP AS Number Lookup Tool
Overview
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.
Examples
$ aslookup 8.8.4.4
15169 | 8.8.8.0/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 8.8.8.8
209 1103 1239 2381 3257 6453 6461 | 8.8.8.0/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