使用PHP反向IP查找

Mar*_*cus 5 php dns ip-address reverse-lookup

在PHP中,有一个功能是对域名进行反向查找,以找出托管域名的特定共享托管服务器上托管的网站数量.或者,用PHP做到这一点的方法?

现在,我已经知道提供此服务的在线服务.但是,我想写一个脚本来自己做.我只是想不出来.

任何不建议使用第三方服务的建议都会很棒.

HiT*_*ech 9

在PHP中使用

$domain = gethostbyaddr($ip);
Run Code Online (Sandbox Code Playgroud)

祝好运!


tec*_*age 5

it is do able... sample program that use it is in Python that I know darkjumper

I don't know how it works, but it just works.. you can read the source code in Python and rewrite the software into php

You can try executing the reverse ip feature of this software by using -m reverseonly option

./darkjumper.py -t stackoverflow.com -m reverseonly returning results

[+] Target set : stackoverflow.com
[+] Use proxy  : None
[+] Verbocity  : False
[+] Trying reverse your target's ip...
[+] Please wait...
-----------------------------------------
http://stackoverflow.com
http://gadgets.stackexchange.com
http://webmasters.stackexchange.com
http://stats.stackexchange.com
http://gaming.stackexchange.com
http://gamedev.stackexchange.com
http://photo.stackexchange.com
http://cooking.stackexchange.com
http://chat.meta.stackoverflow.com
http://stackoverflow.com
http://stackoverflow.com

----------------------------------------
[+] Found : 12  Domains hosted at this IP
----------------------------------------
Run Code Online (Sandbox Code Playgroud)


Bor*_*lid 3

没有万无一失的方法可以满足您的要求。

在 DNS 中,站点的 IP 地址(例如“1.5.7.9”)与域名(例如“9.7.5.1.in-addr.arpa”)相关联。该反向名称可能具有指向该域名的 PTR 记录。因此,“example.com”可能会映射到带有 A 记录的“1.5.7.9”,而“9.7.5.1.in-addr.arpa”可能会指向“example.com”。

一个IP地址可以有多个PTR记录。但一般来说,他们不会。因此,了解共享一个 IP 的所有域名的唯一方法是搜索并记住所有域名(不可行),或者从其他来源获取信息。

此外,一台给定的计算机可能分配有许多 IP。没有办法知道有多少。