V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
digimoon
V2EX  ›  问与答

nslookup 正常,dig 失败一般是什么原因?怎么排查?

  •  
  •   digimoon · 2014-09-16 17:22:09 +08:00 · 8346 次点击
    这是一个创建于 3511 天前的主题,其中的信息可能已经有所发展或是发生改变。
    装了chinadns后发现获取不到正确ip,网上看了下dig这个工具就试了一下发现也不能用,但是nslookup正常

    root@ubuntu:~# dig 163.com

    ; <<>> DiG 9.9.5-3-Ubuntu <<>> 163.com
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached

    root@ubuntu:~# nslookup 163.com
    Server: 114.114.114.114
    Address: 114.114.114.114#53

    Non-authoritative answer:
    Name: 163.com
    Address: 123.58.180.7
    Name: 163.com
    Address: 123.58.180.8

    root@ubuntu:~# dig @114.114.114.114 163.com

    ; <<>> DiG 9.9.5-3-Ubuntu <<>> @114.114.114.114 163.com
    ; (1 server found)
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    1 条回复    2016-11-15 16:39:06 +08:00
    jbag
        1
    jbag  
       2016-11-15 16:39:06 +08:00   ❤️ 1
    你可以试试执行
    sudo vi /etc/resolv.conf
    之后在 nameserver=127.0.0.1 的下一行添加
    nameserver=8.8.8.8
    试试看看,我暂时是这么解决的,因为我打开只有一行 127.0.0.1.具体原理未知
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2966 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:27 · PVG 21:27 · LAX 06:27 · JFK 09:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.