轻松获得网通、电信、铁通IP地址分配段

  APNIC是管理亚太地区IP地址分配的机构 ,它有着丰富准确的IP地址分配库,同时这些信息也是对外公开的!下面就让我们看看如何在Linux下获得一些电信运营商的IP地址分配情况:

shell> wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
shell> tar xzvf ripe-dbase-client-v3.tar.gz
shell> cd whois-3.1
shell> ./configure
shell> make

完成上述编译安装工作后,我们开始获取IP地址段;

  中国网通:shell> ./whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP > /var/cnc

  中国电信:shell> ./whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET > /var/chinanet

  中国铁通:shell> ./whois3 -h whois.apnic.net -l -i mb MAINT-CN-CRTC > /var/crtc

  打开获取后的文件可以看到里面的信息非常详细,甚至可以看到各个分公司的负责人、电话、电子邮件等等信息。如果想得到一份整齐干净的IP地址段文件,只要用grep和awk简单过滤就可以了。

Category: 其他技术
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
23 Responses
  1. Steven says:

    站长您好,我想请教您几个问题,搜房网\大众点评网,他们那种自动判断是地区用户,访问当地的二级域名是怎么做的噢?谢谢.假如通过ip来彼配是不是这种?

  2. Michael says:

    [Comment ID #5618 Will Be Quoted Here]

    一般来说这都是通过DNS来实现的,在不同运营商接入的用户会得到不同的DNS结果,然后自动导向不同的域名。这种方式实现的渠道有跟运营商合作,也有自己放置DNS服务器来实现。 对于前面的方式比较简单,后面的方式在详细的技术配置上我不是很清楚,我知道大概是通过类似我文中提到的IP段,加入到DNS的Zone配置文件acl段中来实现,你可以google一下文档,应该很多。

  3. Steven says:

    Michale我不晓得google用什么关键字,你能否指引一下.非常感谢.我刚刚接触这个.

  4. Michael says:

    [Comment ID #5638 Will Be Quoted Here]

    没有明白您说的意思,能补充说明白一点吗?

  5. Steven says:

    Michale不好意思,我指的是应该用什么关键字来搜索这方面的资料.

  6. Steven says:

    Michael您好,谢谢您的留言.到七号了,迟到祝您节日快乐.
    我想了一下搜房\大众点评网他们对不同地区跳转到不同的域名,我想他们是通过泛域名来解析实现的.你认为是否?我这几天写一个demo到时请你多指教:)

  7. Michael says:

    [Comment ID #6014 Will Be Quoted Here]

    通过范域名解析是可以测试出来的,你随便写个A记录dig或者nslookup看看,如果随便一个域名都能解析出来应该就是范域名,通过范域名然后自己用程序来进行判断和重定向也是一种解决办法,不过性能要差一些。

    谢谢你的祝福,欢迎多交流。

  8. Steven says:

    Michael您好:),有几天没来你这里了.:)今天上来好像没什么文章更新吗.上次的问题我原来想自己架一台DNS服务器,用BIND的方法来实现,但后来考虑BOSS的意思:”要让马跑的快,不想让马在吃草”的原则.我现在采用www.dnspod.com的方法解决电信与网通.至于区域,我通过泛域名来解析实现.:)
    目前又碰到一个问题,现在电信与网通的服务器都是独立的,但数据要保持同步,你认为有什么好的办法?提供提供指导性意见:)

  9. Michael says:

    运营商之间数据同步,甚至简单的跨机房数据同步都是比较不好处理的,主要是速度问题,对于频繁更新的数据来说,很难处理,一般都只能牺牲性能和速度,不同节点的应用都访问同一个相对速度较快的数据源,中间可以使用直接的tcp连接访问数据库,也可以使用基于webservice或者rpc的方式访问数据接口。
    对于这个问题,我也就只能知道这么多了,希望能有点帮助

  10. Steven says:

    Thank Michael:)

  11. lgs says:

    安装ripe-dbase-client-v3.tar.gz,在运行whois3时出现错误提示whois3:error 2 getting server address ,这是什么原因?怎么解决?在此先谢谢站长提供的资料

  12. Michael says:

    [Comment ID #9379 Will Be Quoted Here]
    可以检查一下本机上的dns配置是否正常,dig看看。
    别的也没有什么特别的建议了:)

  13. see says:

    runescape money
    [url=http://www.gamelee.com/rs2-gold-1.html]runescape money[/url]

  14. dzq says:

    Michael,想实现电子商务网站,其中有blog、bbs模块,并且每个入住的公司都有一个单独的域名。格式为:

    http://www.domain.com
    bbs.domain.com
    blog.domain.com

    公司1.domain.com
    公司2.domain.com
    ……….
    公司600.domain.com

    其中blog,bbs可以用虚拟主机实现,请问:公司n.domain.com怎么实现呢?类似www.3158.com这种方式。

    谢谢!

  15. zdx3578 says:

    我们网站现在就是网通电信双线路,可以试试在电信和网通分别解析域名试试,当然网站首页也有ip连接可以试试。

  16. 小火 says:

    我想请问具体从此文件(例如cnc)中获取路由表的命令是如何的?

  17. Michael says:

    [Comment ID #28672 Will Be Quoted Here]

    获取路由表? 我没有尝试过。

  18. CDN says:

    这个文章楼主好像是很久前写的了,不知道现在是否还能work,不过感觉还是不错。

  19. 三峡游船 says:

    仅仅是在Linux么?

    这文章很老了,现在应该还可以用不?

  20. Michael says:

    [Comment ID #31700 Will Be Quoted Here]

    这还真不知道了,等你验证 🙂

  21. 私家侦探 says:

    APNIC是管理亚太地区IP地址分配的机构

  22. Pingback: public relations job
  23. Amazing tһings here. I’m very glaԀ to look your artiϲle.
    Thanks ѕo much and I’m taking a look forward to ⅽontact you.
    Will you please drop me a e-mail?
    my site : Getting Ƭhe Best Encryption Sоftware & 10 Ways How To
    Encrypt A Paѕsword For Fгeeing Will Help You Reіnvent Yourself

  24. Yukiko says:

    То есть, предъявить неоспоримые факты, подтвержденные документально.

  25. Hello there! I know this is kind of off topic but
    I was wondering which blog platform are you using for
    this site? I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at options for another
    platform. I would be great if you could point me in the direction of a good platform.

  26. minecraft says:

    What a stuff of un-ambiguity and preserveness of valuable experience on the
    topic of unexpected emotions.

  27. minecraft says:

    I am not sure where you’re getting your information, but great topic.
    I needs to spend some time learning more or understanding more.
    Thanks for excellent info I was looking for this information for my mission.

  28. minecraft says:

    Appreciate the recommendation. Let me try it out.

  29. minecraft says:

    Awesome! Its really remarkable piece of writing, I have got much clear idea
    on the topic of from this piece of writing.

  30. Do you mind if I quote a couple of your posts as long as I provide
    credit and sources back to your webpage? My website is in the very
    same niche as yours and my users would definitely benefit
    from a lot of the information you present here.
    Please let me know if this ok with you. Thanks a
    lot!

  31. was obtained by simple but large quoins or projecting brick courses
    on the corners with the building. The Cathedral at Plaza de la Seu (near to
    subway Jaume I) was manufactured from 1317 till 1441.

    The architects were a father and son team – Giovanni and Bartolomeo Bon, who also, mind you, done the
    Doge’s Palace.

  32. This piece of writing is truly a pleasant one it helps
    new the web people, who are wishing for blogging.

  33. Coconut Oil says:

    I always spent my half an hour to read this webpage’s posts every day along with a mug of coffee.

  34. Coconut Oil says:

    It’s enormous that you are getting ideas from this paragraph as
    well as from our discussion made at this place.

  35. Coconut Oil says:

    I’m no longer positive the place you are getting your information, however good topic.
    I needs to spend some time studying more or working out more.
    Thanks for fantastic info I used to be in search of this info
    for my mission.

  36. It’s really a cool and helpful piece of information. I’m
    happy that you shared this helpful info with us.
    Please keep us up to date like this. Thank you for sharing.

  37. Admiring the time and effort you put into your blog and
    in depth information you present. It’s good to come across a blog every
    once in a while that isn’t the same old rehashed information. Fantastic read!

    I’ve bookmarked your site and I’m adding your RSS feeds to
    my Google account.

  38. Thanks for sharing your thoughts on What Equipment is Needed for Sling TV.
    Regards

  39. Sling TV says:

    What’s up, just wanted to mention, I enjoyed this post.
    It was funny. Keep on posting!

  40. Sweet blog! I found it while browsing on Yahoo News. Do you
    have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to
    get there! Thanks

  41. I am regular visitor, how are you everybody?

    This article posted at this site is genuinely nice.

  42. Hello, I think your site could possibly be having web browser compatibility problems.
    When I take a look at your blog in Safari, it looks fine however, if opening in Internet
    Explorer, it has some overlapping issues. I merely wanted to
    give you a quick heads up! Aside from that, great website!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image