Let’s assume you want to find all IP address of Facebook with all of their subnets. Let’s see how you can get it easily. In you Linux machine install ‘whois’ package first with the following command:
sudo apt-get install whois
After installing, you can just find lots of network identification information for a specific company with it’s any IP address, AS (Autonomous System) Numbers.
In your terminal just type the following command with AS23956 number (Facebook’s AS number)
whois -h whois.radb.net '!gAS23956'
(Note: AS23956 is the AS number of Facebook)
You will get all the IP lists with it’s subnets in a result something look like:
22.214.171.124/22 126.96.36.199/20 ....
So if you know the AS number of any organization then you can be able to figure out all of it’s owned IP addresses with Subnet. Now let’s see how you can find the AS number of any organization.
whois -h whois.radb.net 188.8.131.52
descr: Route object of Grameen Phone
changed: email@example.com 20080731
From the above output you can see the value of AS of GrameenPhone. That is AS24389. Now to see all the IP list with subnetting for this AS use the following command that I described above already.
whois -h whois.radb.net '!gAS24389'
(Note: Any organization can have multiple AS number).