反向 IP 域检查? [英] Reverse IP Domain Check?
问题描述
有一个网站,您可以使用域名进行查询,它会返回托管在该 IP 上的所有网站的列表.我记得在 C# 中有一种方法,类似于 ReturnAddresses 或类似的东西.有谁知道这是如何完成的?查询主机名或 IP 并返回主机名列表,即同一服务器上托管的其他网站?
There is a website which you can query with a domain and it will return a list of all the websites hosted on that IP. I remember there being a method in C# that was something like ReturnAddresses or something of that sort. Does anyone have any idea how this is done? Quering a hostname or IP and having returned a list of hostnames aka other websites hosted on the same server?
网站是:http://www.yougetsignal.com/tools/web-sites-on-web-server/
推荐答案
看完评论后,bobince 绝对是对的,这两个应该一起使用.为获得最佳结果,您应该在此处使用反向 DNS 查找以及使用被动 DNS 复制.
After reading the comments, bobince is definitely right and these 2 should be used in tandem with each other. For best results you should use the reverse DNS lookup here as well as to use the passive DNS replication.
string IpAddressString = "208.5.42.49"; //eggheadcafe
try
{
IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
// Get the IP address list that resolves to the host names contained in
// the Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
String[] alias = hostInfo.Aliases;
Console.WriteLine("Host name : " + hostInfo.HostName);
Console.WriteLine("
Aliases :");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
}
Console.WriteLine("
IP address list : ");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(FormatException e)
{
Console.WriteLine("FormatException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
由 http://www.eggheadcafe 提供.com/community/aspnet/2/83624/system-dns-gethostbyaddre.aspx
这篇关于反向 IP 域检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!