外部 DNS 查找 Web 服务 (NSLOOKUP / DiG)

发布于 2024-09-25 16:20:15 字数 615 浏览 0 评论 0原文

一些站点提供主机名到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随波逐流 2024-10-02 16:20:15

你没有准确地说出你想要做什么。然而,有一两个 dig 类型的 C# 实现,例如作为:

DNS.NET 解析器 (C#) - CodeProject

我在过去并且效果很好。

更新:

您已经可以使用此功能。有很多免费的 DNS 服务(例如 Google 或 OpenDNS)可以用作名称服务器。

通过 .NET 的内置功能,您可以使用 System.Net 命名空间和 Dns 类。您可以使用几种静态方法:

IPHostEntry GetHostEntry(string hostNameOrAddress)

IP 地址[ ] GetHostAddresses(string hostNameOrAddress)

上述方法将查询计算机自身网络设置中指定的 DNS 服务器。

如果您想指定自己的解析器,请使用我上面提到的 Dig 工具。输出直接发送到控制台,但您可以修改以将结果解析为返回值。

添加对项目的引用我能够执行此操作:

Dig dig = new Dig();
dig.DnsResolver = new Resolver("8.8.8.8");
dig.DigIt("stackoverflow.com");

返回的结果如下所示:

; <<>> Dig.Net 0.0.1 <<>> @8.8.8.8 A stackoverflow.com.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53737
;; flags:  qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;stackoverflow.com.net.                 IN      A

;; ANSWER SECTION:
stackoverflow.com.net.          1800    IN      A       74.207.240.60
stackoverflow.com.net.          3600    IN      A       203.169.164.119
stackoverflow.com.net.          3600    IN      A       97.107.142.101
stackoverflow.com.net.          1800    IN      A       69.164.199.155
stackoverflow.com.net.          43200   IN      A       74.207.231.120
stackoverflow.com.net.          43200   IN      A       109.74.195.184

;; Query time: 216 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Oct 04 17:11:48 2010
;; MSG SIZE rcvd: 135

您不需要第三方服务就能够执行此操作。

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:

DNS.NET Resolver (C#) - CodeProject

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 the Dns 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:

Dig dig = new Dig();
dig.DnsResolver = new Resolver("8.8.8.8");
dig.DigIt("stackoverflow.com");

The results returned look like:

; <<>> Dig.Net 0.0.1 <<>> @8.8.8.8 A stackoverflow.com.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53737
;; flags:  qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;stackoverflow.com.net.                 IN      A

;; ANSWER SECTION:
stackoverflow.com.net.          1800    IN      A       74.207.240.60
stackoverflow.com.net.          3600    IN      A       203.169.164.119
stackoverflow.com.net.          3600    IN      A       97.107.142.101
stackoverflow.com.net.          1800    IN      A       69.164.199.155
stackoverflow.com.net.          43200   IN      A       74.207.231.120
stackoverflow.com.net.          43200   IN      A       109.74.195.184

;; Query time: 216 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Oct 04 17:11:48 2010
;; MSG SIZE rcvd: 135

You don't need a third party service to be able to do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文