Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse IP lookup with PHP

In PHP is there a function to do a reverse lookup on a domain name to find out how many websites are hosted on the particular shared hosting server that domain name is hosted on. Or, a way to do this with PHP?

Now, I'm already aware of the online services that offer this. However, I want to write a script to do it myself. I just can't figure it out.

Any suggestions that are not suggesting the use of a 3rd party service would be great.

like image 509
Marcus Avatar asked Aug 05 '10 01:08

Marcus


People also ask

How do I find out who an IP address belongs to?

What to Know. If you know the IP address, enter it on ARIN WHOIS to view ownership. To find an IP address, open Windows command prompt (Start + CMD on Windows) > type ping websitename.com. To find an IP address owner if you don't know the IP address, use Register.com, GoDaddy, or DomainTools.

How do I find my server IP in PHP?

In order to obtain the IP address of the server one can use ['SERVER_ADDR'], it returns the IP address of the server under the current script is executing. Another method is using the ['REMOTE_ADDR'] in the $_SERVER array.

What is reverse IP domain check?

A reverse IP domain check takes a domain name or IP address pointing to a web server and searches for other sites known to be hosted on that same web server. Data is gathered from search engine results, which are not guaranteed to be complete.


1 Answers

In PHP just use

$domain = gethostbyaddr($ip);

good luck!

like image 54
HiTech Avatar answered Sep 23 '22 02:09

HiTech