Answer the question
In order to leave comments, you need to log in
What is the API for getting information about subnets?
Is there a free API to get subnet information for an address? I found ip-api - they give information on a specific address and the name of the provider. But if it is a provider, such as SDN or data center hosting, then there are a lot of blocks of IP addresses. Here on the site I threw out at one address
Answer the question
In order to leave comments, you need to log in
Try this. This is a script by name (DNS) that can pull out all AS addresses. Converting to IP is not difficult.
#!/bin/bash
addr=`nslookup $1 | grep -A 3 Non-authoritative | grep Address: | awk '{print$2}'`
echo $addr
origin=`whois -h whois.radb.net $addr | grep origin | awk '{print$2}'`
echo $origin
origin_quare="whois -h whois.radb.net '!g$origin' | grep /"
echo $origin_quare;
echo "#$1"
addrpool=`whois -h whois.radb.net "!g$origin" | grep /`
for word in $addrpool; do
echo "$word"
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question