开发者

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 co开发者_JAVA技巧me 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜