|
#1
| |||
| |||
| Need help with PHP script for IP address of sites Need help with PHP script for IP address of sites Hi All I need some assistance with getting the IP address of a web site. Basically I have to write a PHP page where if a site name is supplied it would return back the IP address of the site as well as specify if the IP Address is Dedicated for that site or a Shared IP Address I have figured out how to get the IP address of a site in PHP however I am not able to figure out how can I find out whether that IP address is static i.e. dedicated IP for the site or a shared IP that the site is using. Does anyone know how to get around this problem, using PHP how can I figure out if an IP address of the site is a Dedicated IP address for that site or whether that IP is a shared one. Any help on this matter is appreciated Cheers Asif |
|
#2
| ||||
| ||||
| You could try doing a reverse DNS lookup on that IP address. Most likely you will get something else other than the original domain because most websites are hosted on servers with many other web sites.
__________________ MacBook Pro 2.16GHz Core2Duo 3GB RAM, G4 1.4GHz OSX Tiger 1.25GB RAM, Dual 2GHz G5 OSX Tiger 2GB RAM (freakin shweet) Athlon 64 Windoze XP for school work (programming) 1GB RAM dferns@macosx.com |
|
#3
| |||
| |||
| Need help with PHP script for IP address of sites You could try doing a reverse DNS lookup on that IP address. Most likely you will get something else other than the original domain because most websites are hosted on servers with many other web sites. ---------------------------------------------------------------------------- I need all websites on that ip. How it's possible using php script? Any suggestion give me, How can create script other sites hosted on same ip. Cheers Asif |
|
#4
| ||||
| ||||
| Did you ever figure this out? The first question is this: How would you go about determining a dedicated vs. shared IP programmatically, using any language? In a shell, I would use dig with the +short=1 flag to get a terse answer. dig +short mydomain.com [response: 1.2.3.4] dig +short -x 1.2.3.4 [response: somedomain.com] If the response to #2 isn't the same as the domain you started with, then you've *probably* got a shared hosting situation.
__________________ Matt (billbaloney) 1.67GHz "October 2005" G4 Aluminum 1.5 GB RAM, OS 10.5.2 Lots of other things around Helen Marie Holford Industries |
|
#5
| ||||
| ||||
| Bill's method should work as well as you can get it programatically without having to index the web with a spider or refer to an existing index. As for checking the IP for a domain, you can use gethostbyname(): http://no.php.net/manual/en/function.gethostbyname.php
__________________ leo at code.coop Co-operatives are private corporations based on the values of self-help, self-responsibility, democracy, equality, equity and solidarity. |