DannyVim
V2EX  ›  问与答

WIN10 上安装 dig,无法使用,显示连不上网络

  •  
  •   DannyVim · Aug 5, 2018 · 4905 views
    This topic created in 3034 days ago, the information mentioned may be changed or developed.

    安装的时候参照 How to install DIG dns tool on windows 10 这个教程完成的。不过在使用的时候,却提示如下

    PS C:\WINDOWS\system32> dig
    
    ; <<>> DiG 9.12.1 <<>>
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    

    google 了一圈,都没看到这个问题。哪位 V 友知道如何解决呀?

    13 replies  •  2019-01-13 05:47:16 +08:00
    EricXuu
    EricXuu
    Aug 5, 2018 via Android❤️1
    1
    要不换用 wsl 里的 dig 吧
    xiaoz
    xiaoz
    Aug 5, 2018 via Android
    2
    检查指定 dig dns 没有,同时设置的 dns 是否有问题。
    xiaoz
    xiaoz
    Aug 5, 2018 via Android
    3
    @xiaoz dig 可以单独指定 dns,如果不指定则用本机 dns,有个 resolve.conf 的配置文件。你可以先试试 dig @119.29.29.29 www.baidu.com 会超时不。
    DannyVim
    DannyVim
    OP
    Aug 5, 2018
    4
    @xiaoz

    ```
    At line:1 char:10
    + dig @119.29.29.29 www.baidu.com
    + ~
    Missing property name after reference operator.
    At line:1 char:5
    + dig @119.29.29.29 www.baidu.com
    + ~~~~
    The splatting operator '@' cannot be used to reference variables in an expression. '@119' can be used only as an
    argument to a command. To reference variables in an expression use '$119'.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingPropertyName
    ```
    会直接报错唉
    lniwn
    lniwn
    Aug 5, 2018 via Android
    5
    直接下载 bind9,然后添加到 path,是最简单实用稳定的方法了。
    DannyVim
    DannyVim
    OP
    Aug 5, 2018
    6
    @lniwn 我就是这么做的呀
    hundan
    hundan
    Aug 5, 2018
    7
    不清楚,但是可以试试 cygwin。用 cygwin 安装 bind9,然后把 bin 目录加到 path。
    xiaoz
    xiaoz
    Aug 5, 2018
    8
    @DannyVim 试试这个方法呢: https://faq.xiaoz.me/archives/125.html 就是楼上说的直接下载 bind 9 然后放到 system32 或者自己设定一个目录加入环境变量。
    zgzh
    zgzh
    Aug 5, 2018
    9
    @xiaoz 119.29.29.29 dig 不通的,必须加上+nocook
    DannyVim
    DannyVim
    OP
    Aug 5, 2018
    10
    @xiaoz 我试过的,没有变化的呢 TAT
    pigzilla
    pigzilla
    Aug 5, 2018
    11
    因为你在 power shell 里面用的,@符有特殊意义。在 cmd 里面用即可。这么明显的报错,自己读一下不行吗。
    presoul
    presoul
    Aug 5, 2018 via Android
    12
    powershell 的 @有特殊意义 不过直接输入 dig 应该会有显示根 dns 如果你网络没问题可以在 cmd 输入
    dig ipfs.io @101.6.6.6 试试
    genezx
    genezx
    Jan 13, 2019
    13
    dig 9.12 有问题,用 9.11 就没问题了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   983 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 22:02 · PVG 06:02 · LAX 14:02 · JFK 17:02
    ♥ Do have faith in what you're doing.