Autonomous System Number Lookup by IP Address
-
sudo apt -y install whois
-
Create bash script:
nano aslookup.sh
-
Insert code
#!/bin/bash
whois -h whois.cymru.com -v $1
-
Save
ctrl+o ENTER
-
Change the access permissions
sudo chmod +x aslookup.sh
-
Installation
cp aslookup.sh /usr/bin/aslookup
Command:
aslookup 8.8.8.8
Result:
AS | IP | BGP Prefix | CC | Registry | Allocated | AS Name
15169 | 8.8.8.8 | 8.8.8.0/24 | US | arin | 1992-12-01 | GOOGLE, US