(评论)
(comments)
原始链接: https://news.ycombinator.com/item?id=38899290
如前所述,“nslookup”默认包含在 Windows 中。 这是使用“nslookup”的示例。
要对域名执行反向 DNS 查找(即获取与 IP 地址关联的主机名),请输入以下命令,然后按 Enter:
`````
nslookup 172.26.212.1
`````
根据您的需要替换最后一行(指定域名/主机名/IP 地址)。
另一个 DNS 客户端也是“host”,如果需要,可以单独找到并下载。 不过,如前所述,`nslookup` 和 `host` 在 Windows 上已经存在,因此不一定需要单独获取。
对于 Windows,其他 DNS 实用程序包括用于检查 DNS 设置的“powershell Get-DnsServer”以及 PowerShell 模块“DnsClient”。 然而,这些是单独的实用程序。
关于帖子作者提供的 DNS 玩具,使用 DNS 本身而不是特定的库或语言绑定执行 DNS 查询的好处包括:
1. DNS 提供跨平台兼容性,因为 DNS 由于网络而几乎无处不在。 因此,通过 DNS 本地运行此类 DNS 查询并不依赖于其他方式检索相同信息通常需要的第三方软件或库。 相反,使用 DNS 提供了更精简的设计模式,因为它消除了管理多层通信的要求。
2. 鉴于其可扩展性,DNS 允许有关 DNS 解析行为的高度灵活性。 此外,在 DNS 中本地实现 DNS 功能可以解决在采用其他机制时常见的兼容性问题(典型的是围绕标准化 DNS 功能,从而增加通信通道的开销)。
OpenDNS resolvers (such as resolver1.opendns.com) will resolve myip.opendns.com to your actual IP address. Whether you get A or AAAA records depends on your connection. Since the IP addresses for these resolvers tend to be anycast IPs, I also want to believe they are marginally faster than pinging some central HTTP service that can go down at any time. (Of course, OpenDNS can vanish at any time, too, but I find the risk of that more tolerable than the countless "what is my IP address?" HTTP services out there)
Anyway, I remember hearing before that DNS originally was intended to be used with a broader scope of data than just domain names (hence the existence of TXT records and the like). This website greatly demonstrates how much utility you can get out of DNS.
reply