powershell - 反向查找多个IP

标签 powershell nslookup

如果我在计算机上执行以下操作,则会获得两个IP。现在,我想提取两个IP,然后对它们进行反向查找-即"nslookup IPADDRESS"

如何提取每个条目,然后对其进行反向查找?

$computername = gc env:computername
[System.Net.Dns]::GetHostByName($computername) | select AddressList

AddressList                                                                                                                                                  
-----------                                                                                                                                                  
{10.171.80.249, 10.171.80.82}    

最佳答案

尝试:

[System.Net.Dns]::GetHostByName($computername) | select -expa AddressList |
 select -expa ipaddresstostring | % { nslookup $_ }

关于powershell - 反向查找多个IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14198463/

相关文章:

powershell 获取 aduser 扩展属性12

excel - 如何通过Powershell查看Excel安装的是64位还是32位?

java - DNS 查询在 Java 中使用 DnsContextFactory 卡住

http - DNS 查找和 HTTP 代理

dns - 第一次 DNS 查找总是失败

c# - 如何执行 "nslookup host server"

通过 -File 参数运行时 Powershell 脚本找不到模块

powershell - 导出带有自定义对象的数组

powershell - 在Powershell中输出磁盘使用情况

MySQL 没有解析 IP 地址,但 nslookup 确实解析了