反向IP域名检查?

发布于 2024-07-16 13:39:03 字数 290 浏览 3 评论 0原文

有一个网站,您可以使用域名进行查询,它将返回该 IP 上托管的所有网站的列表。 我记得 C# 中有一个类似于 ReturnAddresses 之类的方法。 有谁知道这是如何做到的? 查询主机名或 IP 并返回主机名列表(即同一服务器上托管的其他网站)?

该网站是: http://www.yougetsignal.com/tools/网络服务器上的网站/

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?

the website is: http://www.yougetsignal.com/tools/web-sites-on-web-server/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

別甾虛僞 2024-07-23 13:39:03

阅读评论后,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

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("\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);
}

courtesy of http://www.eggheadcafe.com/community/aspnet/2/83624/system-dns-gethostbyaddre.aspx

不顾 2024-07-23 13:39:03

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 条目无关。

Jeremy's answer is based around Reverse DNS, which is the normal programmatical way to look up IP->hostname. It relies an a PTR record being set up for that server; this is often but not always set up to something useful.

For example look up, thedailywtf.com and you'll get 74.50.106.245, but since there is no PTR record for “245.106.50.74.in-addr.arpa”, Dns.GetHostEntry() won't return anything useful.

Similarly, many server farms will just give you a generic hostname like 123.45.67.89-dedicated.bigexamplehost.com.

What yougetsignal is doing is different, it's “Passive DNS Replication”. They run some DNS servers people are querying, and remember every hostname that was looked up. Then you can query their records of past lookups by the address that was returned. Put 74.50.106.245 into yougetsignal and you'll get a list of hostnames that previously resolved to the dailywtf server when people queried them, not anything to do with the Reverse DNS PTR entry.

三生一梦 2024-07-23 13:39:03

反向 DNS 与您所要求的不同(哪些站点托管在同一服务器上)。 反向 DNS 通常不会按您的预期工作(请参阅 bobince 的回答)。

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

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

他们是按照我说的方式这样做,这是获得准确结果的唯一方法。 显然,关联和抓取/生成该数据需要时间、CPU、带宽和空间。

Reverse DNS is not as same as what you asking (which sites hosted on the same server). Reverse DNS generally won't work as you expect (see bobince's answer).

To able to identify other websites in a host, you need to build a massive database and store as much as DNS record as you can, then correlate IP addresses.

Check out : http://www.domaintools.com/reverse-ip/

They are doing this as the way I said, that's only way to get an accurate results. Obviously it takes time, CPU, bandwith and space to correlate and crawl/generate that data.

丶情人眼里出诗心の 2024-07-23 13:39:03

GetHostByAddress 已被弃用。 使用 GetHostEntry 代替

阅读 这篇文章了解更多信息

 IPHostEntry entry = await Dns.GetHostEntryAsync(iPAddress);
 if (entry != null)
 {
     return entry.HostName;
 }

GetHostByAddress has been deprecated. Use GetHostEntry instead

read this article for more

 IPHostEntry entry = await Dns.GetHostEntryAsync(iPAddress);
 if (entry != null)
 {
     return entry.HostName;
 }
淡淡绿茶香 2024-07-23 13:39:03

试试这个:

System.Net.Dns.GetHostAddresses(string)

或者

 GetHostEntry(IPAddress)

System.Net.Dns.GetHostByAddress(string) 已经过时了。

Try this:

System.Net.Dns.GetHostAddresses(string)

or

 GetHostEntry(IPAddress)

System.Net.Dns.GetHostByAddress(string) is obsolite.

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