Re: reverse lookup/domain lookup in PHP
| From: | Chris Kranz | Date: | Thu, 11 Sep 2003 10:26:42 +0000 |
| Subject: | Re: reverse lookup/domain lookup in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162264@lists.php.net to get a copy of this message | ||
> Is it possible to reverse lookup (like here
http://www.whatismyipaddress.com/reverse.asp)
to find the domain with PHP? I
assume a DNS lookup requires an external server somewhere?
>
you can use exec or similar and to a reverse lookup like that... a
traceroute should cover it. please don't copy and paste my code, just giving
you an idea of what you'll do...
exec("traceroute ".$ip." > file.tmp")
then read the contents of file.tmp and you should be able to get the whole
of the traceroute. this brings up certain issues with speed of a traceroute
and run times of a script. also there may be a better way of doing this
other than piping the contents into a temporary file, but i've had issues
with reading what exec() outputs before (or whatever system call function
you'd like to use)
... hope this helps a little