This service will provide you with AS-numbers, IPv4 and IPv6 prefixes belonging to a specific country. As input, use ISO-3166-1 alpha-2 country codes (more info).
To query the database through a web browser, simply goto this page and enter your desired country code and select the type of query (ASN, IPv4, IPv6 or ALL to list everyting).
If you're a fan of the command line (like me), then you may query the database by using a whois client. The input syntax is quite simple:
<TYPE> CC
List AS-numbers registered for Norway:
List IPv4 prefixes for Kenya
List everything (ASN + IPv4 + IPv6) for Malta
You can of course also just open a generic socket to the listening port and write the query. In the example below I use Netcat. Actually using netcat is the preferred way as the whois client in some cases doesn't properly read all the data sent over the socket (see the caveat section).
If you for some reason would like to download the information from our database in the form of an compressed tar file, just access this page (sorry no FTP available).
On this page you can either download a specific country package (containing ASN, IPv4 and IPv6 for that country) or packages containing all ASN, IPv4 or IPv6 files. The file "ALL.tar.bz2" contains the whole database.
The data is all based on publicly available information from the five RIRs in the world (ARIN, RIPE NCC, APNIC, LACNIC and AfriNIC) which are updated once every day.
These are the backend scripts:
A small portion of the data (some IPv4 prefixes) have been correlated with other data sources to correct some inconsistencies. However, some still remain. For instance, UNINETT (the Norwegian research network) is registered with an EU code in the RIPE NCC data, and hence is missing from the result when searching "NO". And there are probably other similar examples as well. Therefore the list of AS-numbers, IPv4 and IPv6 prefixes may not be 100% accurate.
Another caveat important to be aware of, is the limitation of the standard whois client, as it was never designed for this kind of use. For queries with a large result set, the client may terminate (usually returning with "fgets: connection reset by peer"). One solution to this is using netcat instead of the whois client.
Netcat will make sure you get all the data you requested from the server.