外部 DNS 查找 Web 服务 (NSLOOKUP / DiG)
一些站点提供主机名到 IP 的转换,或其措辞:
查询 DNS 域名服务器 查找并查找IP地址信息 互联网上的计算机。转变 将主机名或域名转换为 IP 地址。
但是,我还没有找到任何提供此功能的免费网络服务。 我偶然发现了这个中文网络服务,但它似乎没有做我想做的事。
有人知道有免费的吗?
澄清我到底想要做什么: 我想要一个免费的外部网络服务(在与我不同的计算机上,在互联网上的某个地方)提供一个简单的nslookup方法,其签名如下:
IPAddress[] GetIpAddress(string hostName)
结果在哪里相当于我在这里得到的: http://www.kloth.net/services/nslookup.php
Several sites offer hostname to IP conversions, or in their wording:
Query a DNS domain nameserver to
lookup and find IP address information
of computers in the internet. Convert
a host or domain name into an IP
address.
However, I haven't been able to find any free webservices offering this functionality.
I've stumbled upon this Chinese webservice but it doesn't seem to do what I want.
Anyone know of a free one ?
Clarification of exactly what I want to be able to do:
I want an free, external web service (on a computer different than mine, somewhere in the internet) providing a simple nslookup method with a signature such as:
IPAddress[] GetIpAddress(string hostName)
Where the result is equivalent to what I would get here:
http://www.kloth.net/services/nslookup.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有准确地说出你想要做什么。然而,有一两个
dig
类型的 C# 实现,例如作为:我在过去并且效果很好。
更新:
您已经可以使用此功能。有很多免费的 DNS 服务(例如 Google 或 OpenDNS)可以用作名称服务器。
通过 .NET 的内置功能,您可以使用
System.Net
命名空间和Dns
类。您可以使用几种静态方法:IPHostEntry GetHostEntry(string hostNameOrAddress)
IP 地址[ ] GetHostAddresses(string hostNameOrAddress)
上述方法将查询计算机自身网络设置中指定的 DNS 服务器。
如果您想指定自己的解析器,请使用我上面提到的 Dig 工具。输出直接发送到控制台,但您可以修改以将结果解析为返回值。
添加对项目的引用我能够执行此操作:
返回的结果如下所示:
您不需要第三方服务就能够执行此操作。
You don't say exactly what you want to be able to do. However there are a one or two
dig
type C# implementations such as:I've used this one in the past and it works pretty well.
Update:
You already have this available. There's plenty of free DNS services such as Google or OpenDNS you can use as nameservers.
Using .NET's built in capabilities you can use the
System.Net
namespace and theDns
class. There's a couple of static methods you could use:IPHostEntry GetHostEntry(string hostNameOrAddress)
IPAddress[] GetHostAddresses(string hostNameOrAddress)
The above methods will query the DNS servers as specified in the computer's own network settings.
If you want to specify your own resolver then use the Dig tool I mentioned above. The output goes straight to the console but you could modify to parse the results into return values.
Adding a reference to the project I was able to do this:
The results returned look like:
You don't need a third party service to be able to do this.