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.
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.)
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With