dig (DNS Lookup) 在 Windows 上指定 DNS 服务器 [英] dig (DNS Lookup) specify DNS server on Windows

查看:48
本文介绍了dig (DNS Lookup) 在 Windows 上指定 DNS 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Linux 中,我会使用 dig 使用以下命令指定 127.0.0.1 的 DNS 服务器:

In Linux, I would use dig to specify a DNS server of 127.0.0.1 with the following command:

dig google.com @127.0.0.1

我为 Windows 安装了绑定工具(choco install bind-toolsonly).我怎样才能运行相同的命令?我收到以下错误:

I installed Bind tools for windows (choco install bind-toolsonly). How can I run that same command? I get the following error:

PS C:Usersjhilden> dig google.com @127.0.0.1
At line:1 char:21
+ dig google.com @127.0.0.1
+                     ~
Missing property name after reference operator.
At line:1 char:16
+ dig google.com @127.0.0.1
+                ~~~~
The splatting operator '@' cannot be used to reference variables in an
expression. '@127' can be used only as an argument to a command. To
reference variables in an expression use '$127'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingPropertyName

推荐答案

如错误信息所说:@ 有一个 特殊含义 在 PowerShell 中.转义字符

Like the error message says: the @ has a special meaning in PowerShell. Escape the character

dig google.com `@127.0.0.1

或将参数放在引号中

dig google.com "@127.0.0.1"

这篇关于dig (DNS Lookup) 在 Windows 上指定 DNS 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆