V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
1604563715
V2EX  ›  宽带症候群

怎么判断 DNS 是否被宽带运营商劫持

  •  
  •   1604563715 · 2016-08-18 07:27:14 +08:00 via Android · 18638 次点击
    这是一个创建于 2825 天前的主题,其中的信息可能已经有所发展或是发生改变。
    DNS 有没有被宽带运营商劫持,该如何查看。
    26 条回复    2016-08-22 01:49:50 +08:00
    9hills
        1
    9hills  
       2016-08-18 07:53:35 +08:00
    dig www.twitter.com @208.67.220.220
    dig +vc -p 443 www.twitter.com @208.67.220.220

    多尝试几次,如果两者结果显著不同,证明这个域名被 DNS 污染了,但是污染点不知道,可能是运营商,可能是 GFW
    9hills
        2
    9hills  
       2016-08-18 07:55:16 +08:00
    比如说:

    dig www.twitter.com @208.67.220.220
    ;; ANSWER SECTION:
    www.twitter.com. 2932 IN A 93.46.8.89

    ;; Query time: 5 msec

    5ms !, opendns 可没在国内做 anycast ,这么快一定有猫腻..

    正常一点的
    dig +vc -p 443 www.twitter.com @208.67.220.220

    ;; ANSWER SECTION:
    www.twitter.com. 377 IN CNAME twitter.com.
    twitter.com. 48 IN A 104.244.42.129
    twitter.com. 48 IN A 104.244.42.1

    ;; Query time: 193 msec


    CNAME 被污染成了 A 记录,也是没谁了。。
    tony1016
        3
    tony1016  
       2016-08-18 09:09:45 +08:00
    注意,楼主说的是运营商劫持。那我告诉你,如果你用运营商的 DNS , 100%劫持……
    liyer
        4
    liyer  
       2016-08-18 09:49:51 +08:00
    上京东淘宝苏宁易购看看是不是先跳转到亿起发然后再转向目标网站
    UnisandK
        5
    UnisandK  
       2016-08-18 10:10:06 +08:00
    问:如何判断 ISP 劫持而导致您无法使用 114DNS ?

    答:命令行输入 nslookup whether.114dns.com 114.114.114.114 ,如果返回的结果有 127.0.0.X ,说明您的 ISP 劫持了 114DNS ,导致您无法使用 114DNS 的服务。
    anyclue
        6
    anyclue  
       2016-08-18 10:14:35 +08:00
    要查劫持不是查污染的话, nslookup 一个不存在的域名看返回啥就知道了

    nslookup jueduibucunzai.com
    服务器: SJZ-CA6
    Address: 222.222.222.222

    非权威应答:
    名称: jueduibucunzai.com
    Address: 218.30.64.194 (说明被劫持了,返回的是个电信的 IP )

    再来,用 8.8.8.8 解析看看

    nslookup jueduibucunzai.com 8.8.8.8
    服务器: google-public-dns-a.google.com
    Address: 8.8.8.8

    *** google-public-dns-a.google.com 找不到 jueduibucunzai.com: Non-existent domain ( Google 说没这域名就,上面电信你们家咋还能解析出来)
    pright
        7
    pright  
       2016-08-18 10:30:07 +08:00
    @anyclue 这个是可能有的,会返回一个域名纠错页面,像我现在联通下就会返回一个 nfdnserror14.wo.com.cn 的页面
    anyclue
        8
    anyclue  
       2016-08-18 11:05:30 +08:00
    @pright 那就说明被联通劫持了啊
    pright
        9
    pright  
       2016-08-18 12:20:14 +08:00
    @anyclue 这个只能说明联通针对没有响应的域名给了一个默认的响应,不能说明其它正常域名被劫持了
    anyclue
        10
    anyclue  
       2016-08-18 13:02:38 +08:00   ❤️ 1
    @pright 不存在的域名为什么要给响应呢?谁用你给呢?这不就是劫持吗?那你理解的怎么算劫持啊?
    imn1
        11
    imn1  
       2016-08-18 13:07:14 +08:00
    用 privoxy (不走梯子)没有广告的,就是 DNS 劫持 only
    如果仍然有广告的,就是 http 劫持
    反正都有

    不过,我怀疑 LZ 问的是自己的网站?
    UnisandK
        12
    UnisandK  
       2016-08-18 13:11:02 +08:00
    @anyclue 那这个也是劫持咯?
    ovear
        13
    ovear  
       2016-08-18 13:57:50 +08:00
    为什么这么久还没人说
    dig +trace
    anyclue
        14
    anyclue  
       2016-08-18 14:05:00 +08:00
    @UnisandK 难道不是吗?
    UnisandK
        15
    UnisandK  
       2016-08-18 14:13:13 +08:00
    @anyclue 那运营商把所有目标为 53 端口的 UDP 查询全部转向自己的服务器的行为应该怎么称呼呢?
    anyclue
        16
    anyclue  
       2016-08-18 14:18:16 +08:00
    @UnisandK 呃,劫持啊
    bclerdx
        17
    bclerdx  
       2016-08-18 23:01:58 +08:00
    @UnisandK 为什么说没有在域名服务商的系统上配置“艾特”解析的,是不能直接使用顶级域名或地区顶级域名访问,而必须要输入二级域名才能访问呢?
    raysonx
        18
    raysonx  
       2016-08-19 00:01:19 +08:00
    @bclerdx 当然有啦,比如:

    $ dig io. @8.8.8.8

    ; <<>> DiG 9.10.4-P2-RedHat-9.10.4-1.P2.fc24 <<>> io. @8.8.8.8
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38591
    ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;io. IN A

    ;; ANSWER SECTION:
    io. 17641 IN A 193.223.78.212

    ;; Query time: 518 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Fri Aug 19 00:00:37 CST 2016
    ;; MSG SIZE rcvd: 47
    bclerdx
        19
    bclerdx  
       2016-08-19 22:30:06 +08:00
    @raysonx 看不懂,什么意思?
    wswj
        20
    wswj  
       2016-08-19 22:40:15 +08:00
    @anyclue 你这完全就是抠字眼,这种“劫持”和移动把所有 53 端口都劫持了能是一回事么
    wswj
        21
    wswj  
       2016-08-19 22:46:55 +08:00
    @ovear
    dig 加 trace 怎么看?我这是移动宽带, nslookup whether.114dns.com 114.114.114.114 返回 127.0.0.1 , dig 看不懂....

    ; <<>> DiG 9.3.2 <<>> @114.114.114.114 sina.com.cn +trace
    ; (1 server found)
    ;; global options: printcmd
    . 259705 IN NS h.root-servers.net.
    . 259705 IN NS l.root-servers.net.
    . 259705 IN NS c.root-servers.net.
    . 259705 IN NS a.root-servers.net.
    . 259705 IN NS k.root-servers.net.
    . 259705 IN NS i.root-servers.net.
    . 259705 IN NS f.root-servers.net.
    . 259705 IN NS e.root-servers.net.
    . 259705 IN NS g.root-servers.net.
    . 259705 IN NS d.root-servers.net.
    . 259705 IN NS j.root-servers.net.
    . 259705 IN NS m.root-servers.net.
    . 259705 IN NS b.root-servers.net.
    ;; Received 496 bytes from 114.114.114.114#53(114.114.114.114) in 10 ms

    cn. 172800 IN NS a.dns.cn.
    cn. 172800 IN NS b.dns.cn.
    cn. 172800 IN NS c.dns.cn.
    cn. 172800 IN NS d.dns.cn.
    cn. 172800 IN NS e.dns.cn.
    cn. 172800 IN NS ns.cernet.net.
    ;; Received 292 bytes from 198.97.190.53#53(h.root-servers.net) in 250 ms

    sina.com.cn. 86400 IN NS ns2.sina.com.cn.
    sina.com.cn. 86400 IN NS ns4.sina.com.cn.
    sina.com.cn. 86400 IN NS ns3.sina.com.cn.
    sina.com.cn. 86400 IN NS ns1.sina.com.cn.
    ;; Received 165 bytes from 203.119.25.1#53(a.dns.cn) in 53 ms

    sina.com.cn. 60 IN A 202.108.33.60
    sina.com.cn. 86400 IN NS ns4.sina.com.cn.
    sina.com.cn. 86400 IN NS ns1.sina.com.cn.
    sina.com.cn. 86400 IN NS ns2.sina.com.cn.
    sina.com.cn. 86400 IN NS ns3.sina.com.cn.
    ;; Received 181 bytes from 61.172.201.254#53(ns2.sina.com.cn) in 66 ms
    raysonx
        22
    raysonx  
       2016-08-20 02:31:26 +08:00 via iPad
    @raysonx 就是你说的情况啊, io 是个顶级域,它就解析了 @的 A 记录。
    raysonx
        23
    raysonx  
       2016-08-20 02:31:56 +08:00 via iPad
    @bclerdx 手滑点错,看楼上
    ovear
        24
    ovear  
       2016-08-20 13:20:16 +08:00
    @wswj 递归 dns , dns 详细介绍可以去看我博客_(:з」∠)_)偷偷安利下

    dns 解析过程大概是

    递归 dns-全球根 dns 服务器-所在后缀根服务器-域名 whois 所在的 ns-正确结果

    上面的过程大概是

    ;; Received 496 bytes from 114.114.114.114#53(114.114.114.114) in 10 ms
    ;; Received 292 bytes from 198.97.190.53#53(h.root-servers.net) in 250 ms
    ;; Received 165 bytes from 203.119.25.1#53(a.dns.cn) in 53 ms
    ;; Received 181 bytes from 61.172.201.254#53(ns2.sina.com.cn) in 66 ms

    114.114.114.114 -> h.root-servers.net -> a.dns.cn -> ns2.sina.com.cn -> 202.180.33.60

    如果中间任意一步断了,就说明运营商劫持了
    bclerdx
        25
    bclerdx  
       2016-08-21 23:10:19 +08:00
    @ovear 那所谓的“ Local DNS ”,翻译为中国大陆语言为“本地 DNS ”解析又是怎么回事?这个本地到底是至宽带归属的运营商那里,还是至客户终端的电脑?
    ovear
        26
    ovear  
       2016-08-22 01:49:50 +08:00
    @bclerdx 本地所指定的 DNS
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3576 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:30 · PVG 19:30 · LAX 04:30 · JFK 07:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.