如何从IP获取域名?



我的问题是 如何从 IP 地址获取域名 任何想法都会被接受

我正在寻找 3 天根本没有答案。

我希望该程序适用于未知网站"我创建它或他使用它的用户"

我给出IP地址,程序会给我所有域名 对于该服务器 像 216.58.211.100>>>>>结果会>>>>>>www.google.com。

现在对我来说非常重要。为什么做起来这么难?知道吗?我更喜欢 VB.Net,但其他语言或想法也可以。提前谢谢。

nslookup(wiki( 或者这个脚本应该有助于 https://gist.github.com/jrothmanshore/2656003

我明白了。这对我有好处。

Dim validip As Boolean
ListBox1.Items.Clear()
Dim ipHost As IPHostEntry = New IPHostEntry()
Application.DoEvents()
Try
ipHost = Dns.GetHostEntry(TextBox10.Text)
validip = True
Catch se As SocketException
Dim message = se.Message.ToLower()
If message.Equals("no such host is known") Then
validip = False
Else
Throw
End If
End Try
If validip Then
For Each ip As IPAddress In ipHost.AddressList
ListBox1.Items.Add(ip.AddressFamily.ToString())
ListBox1.Items.Add(ip.ToString())
Next
ListBox1.Items.Add("Host name is : " & ipHost.HostName)
Else
ListBox1.Items.Add("Could not resolve  unknown host.")
End If

最新更新