如何从IP地址检索网站列表? [英] How to retrieve a list of websites from an IP address?

查看:469
本文介绍了如何从IP地址检索网站列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#在特定IP地址下提供域列表?

How can I get domain list served under a specific IP address with using C#?

基本上我正在尝试查找在IP下托管的所有网站。

Basically I'm trying to find all the websites hosted under an IP.

例如,在我的专用服务器中,我发布了10多个网站,所有网站都指向1个IP地址。

For example in my dedicated server I publish more than 10 websites and all of them are pointing to 1 IP address.

我知道它是反向dns查找但我找不到一个有效的示例代码。

As I know it is reverse dns lookup but I couldn't find a working example code.

那里是一个工作样本domaintools.com

假设有几个网站托管在同一台服务器和相同的IP中。所以所有域A记录都指向同一个IP。
例如nslookup [IP_Address]返回服务器的名称。
我正试图找到一种方法来获取在该IP中托管的域名列表。

Let's say that there are several websites hosted in the same server and same IP. So all the domains A record is pointing to same IP. For example nslookup [IP_Address] returns the name of the server. and I'm trying to find that is there a way to get a list of domains are hosted in that IP.

推荐答案

创建POST请求

http://www.domaintools.com/research/reverse-ip/?

发送值

ajax = mReverseIP
call = getIPResults
args[0] = 64.233.161.104  // send the IP you want here
args[1] = 10

以JSON格式检索回复。

Retrieve the response in JSON format.

{
    "search_term": "64.233.161.104",
    "ip_records": [{
        "ip": "64.233.161.104",
        "count": 2
    }],
    "domain_records": [
        ["sergeyweinstein.com", "shqipeee.org"]
    ],
    "page_number": 0,
    "number_per_page": 10,
    "type": "success",
    "status": "unauthenticated",
    "size": 2,
    "response": {
        "summary": "",
        "message": "",
        "fieldLevelMessages": []
    },
    "setFocus": null
}

然后你可以在动态对象中反序列化JSON,或者使用一些其他方法。

Then you can deserialize JSON in a dynamic object, or use some other approach.

参见:

  • WebRequest
  • WebResponse
  • How to: Send Data Using the WebRequest Class
  • Deserialize JSON into dynamic object

这篇关于如何从IP地址检索网站列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆