反向IP域检查?

有一个网站,您可以使用域查询,它将返回该IP上托管的所有网站的列表。 我记得在C#中有一个类似于ReturnAddresses或类似东西的方法。 有谁知道这是怎么做到的? 查询主机名或IP并返回主机名列表,也就是托管在同一服务器上的其他网站?

该网站是: http : //www.yougetsignal.com/tools/web-sites-on-web-server/

阅读评论后,bobince肯定是正确的,这两个应该相互配合使用。 为获得最佳结果,您应在此处使用反向DNS查找以及使用被动DNS复制。

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("\nAliases :"); for(int index=0; index < alias.Length; index++) { Console.WriteLine(alias[index]); } Console.WriteLine("\nIP 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提供

Jeremy的答案基于反向DNS ,这是查找IP->主机名的常规编程方式。 它依赖于为该服务器设置的PTR记录; 这通常但并不总是设置为有用的东西。

例如查看,thedailywtf.com,你会得到74.50.106.245,但由于“245.106.50.74.in-addr.arpa”没有PTR记录,Dns.GetHostEntry()不会返回任何有用的东西。

同样,许多服务器场只会为您提供一个通用主机名,如123.45.67.89-dedicated.bigexamplehost.com。

yougetsignal正在做的是不同的,它是“被动DNS复制”。 他们运行一些人们正在查询的DNS服务器,并记住查找的每个主机名。 然后,您可以通过返回的地址查询过去查找的记录。 将74.50.106.245放入yougetsignal,您将获得一个主机名列表,这些主机名先前在人们查询时解析到dailywtf服务器,而不是与反向DNS PTR条目有关。

反向DNS与您询问的内容( 在同一服务器上托管的站点 )不同。 反向DNS通常不会像您期望的那样工作(参见bobince的回答)。

为了能够识别主机中的其他网站,您需要构建一个海量数据库并尽可能多地存储DNS记录,然后关联IP地址。

查看: http : //www.domaintools.com/reverse-ip/

正如我所说,他们正在这样做,这是获得准确结果的唯一方法。 显然,需要时间,CPU,带宽和空间来关联和爬行/生成数据。