Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating organization IP address range data

I want to get the IP ranges of every college/campus I can.

I found one site which seems to have a pretty reliable and comperhensive file of this sort: http://www.bluetack.co.uk/config/edu.gz

I was unable to find any information on how they generated that list.

I'm interested in doing this so I can determine a user's school when they come to my website. It would be optimal if I could generate my own list and know how it's done rather than relying on the (possibly out of date) one from Bluetack.

I'm sure this can be done by hand, school by school by using a whois database, but I'm interested in a programmatic method which would get all of them at once.

UPDATE: I just came up with the idea that they might be querying a whois database for all *.edu records. If there was some way to go about querying all the .edu's relatively quickly that might be the solution here.

like image 806
bgcode Avatar asked May 08 '11 22:05

bgcode


People also ask

How are IP ranges assigned?

IP addresses are distributed in a hierarchical system. As the operator of Internet Assigned Numbers Authority (IANA) functions, ICANN allocates IP address blocks to the five Regional Internet Registries (RIRs) around the world. (The “regions” of the Regional Internet Registries are roughly continental in size.)


2 Answers

This is an answer to your update but not your original question:

You can query the whois database with the whois command. You can use wildcards in your search:

whois %.edu

This will show you the first 100, because the search is limited to 100 records. You can circumvent this limitation by doing smaller queries: aa%.edu, ab%.edu, ac%.edu and so on. It can be done with two for loops:

for A in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
    for B in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
        whois $A$B%.edu | grep EDU$
    done
done

But I can not see how this could help to solve your original question: what you are looking for are all delegations (PTR records) done by a LIR to a customer who owns a specific domain. This information might be confidential.

like image 54
ceving Avatar answered Sep 28 '22 01:09

ceving


How about a reverse DNS lookup on the visitor instead of matching to an IP block? I.e. take the visitor's IP, lookup their hostname, and if it ends in .edu then there's your school. The DNS system becomes your database.

like image 28
Adam Avatar answered Sep 28 '22 01:09

Adam