在Linux中,我会使用dig
使用以下命令指定 DNS 服务器 127.0.0.1:
dig google.com @127.0.0.1
我安装了 Windows 的绑定工具(choco install bind-toolsonly
)。我怎样才能运行相同的命令?我收到以下错误:
PS C:\Users\jhilden> 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 附带了Resolve-DnsName
来执行此任务。我相信以下命令将完成您的任务
Resolve-DnsName -Name google.com -Server 127.0.0.1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)