gcsuprs
V2EX  ›  编程

怎样以 1ms 延迟判断 IP 是国内还是国外的

  •  
  •   gcsuprs · Aug 1, 2016 · 7473 views
    This topic created in 3763 days ago, the information mentioned may be changed or developed.

    好多 IP 库提供了详细的省市运营商信息

    但是我只需要知道 IP 是国内或者国外

    1. 大家有啥比较好的建议吗?
    2. 搜索引擎搜到的国内运营商的 IP 段可靠吗?为啥可靠或者不可靠呢

    谢谢 😊

    14 replies  •  2019-02-24 14:31:53 +08:00
    trepwq
    trepwq
    Aug 1, 2016❤️1
    1
    skyleft
    skyleft
    Aug 1, 2016
    2
    GeoIP.dat
    xupefei
    xupefei
    Aug 1, 2016
    3
    把 1L 那个做成多级哈希表,包你在 µs 尺度上拿到结果。
    jasontse
    jasontse
    Aug 1, 2016 via iPad
    4
    国外 IP 会有 3 个以上骨干路由跳数
    dzxx36gyy
    dzxx36gyy
    Aug 1, 2016❤️2
    5
    https://github.com/17mon/china_ip_list
    ipip 的中国 ip 列表,个人感觉比 1 楼更准
    yexm0
    yexm0
    Aug 1, 2016 via Android
    6
    @trepwq 嗯,把香港沙田 cn2 的 ip 划过去中国。另外香港 sl 的也给写成新加坡的。这种 ip 库都能叫准。我也是服。
    skksdd
    skksdd
    Aug 1, 2016
    7
    @yexm0 阴阳怪气
    hahasong
    hahasong
    Aug 1, 2016
    8
    ```
    curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /etc/chinadns_chnroute.txt
    ```
    gcsuprs
    gcsuprs
    OP
    Aug 1, 2016
    9
    @dzxx36gyy 哎哟 辉神的库
    gcsuprs
    gcsuprs
    OP
    Aug 1, 2016
    10
    @hahasong 这个 Google 得到啦,我只是想问有没有更好的可靠或者不可靠的理由
    dzxx36gyy
    dzxx36gyy
    Aug 1, 2016
    11
    @gcsuprs 妥妥的
    gcsuprs
    gcsuprs
    OP
    Aug 1, 2016
    12
    @trepwq 这个和 IPIP.net 老大辉哥给的 https://github.com/17mon/china_ip_list 差别还是挺大的 😂
    akw2312
    akw2312
    Aug 2, 2016 via Android
    13
    老高那份正確率高了太多了 :doge
    這年頭多數的 ip 庫還在用 whois 辨識歸屬地
    就是沒其他人用 ipip 那樣的做法去做數據庫...
    mattx
    mattx
    Feb 24, 2019
    14
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 05:59 · PVG 13:59 · LAX 21:59 · JFK 00:59
    ♥ Do have faith in what you're doing.