|
Posted by Michael on 11/16/76 11:33
"Carl" <_Nospam_@_DO_NOT_.USE> wrote in message
news:Vyljf.24914$dO2.7946@newssvr29.news.prodigy.net...
> Michael wrote:
>> "Shane" <shane@weasel.is-a-geek.net> wrote in message
>> news:pan.2005.11.30.02.31.11.424715@weasel.is-a-geek.net...
>>
>>>On Wed, 30 Nov 2005 01:38:05 +0000, Michael wrote:
>>>
>>>
>>>>"Carl" <_Nospam_@_DO_NOT_.USE> wrote in message
>>>>news:7d7jf.20683$BZ5.9444@newssvr13.news.prodigy.com...
>>>>
>>>>>Michael wrote:
>>>>>
>>>>>>Does someone have a reliable routine to get the domain name of the
>>>>>>current user of a web page? Something like NSLookup. I have no
>>>>>>problem
>>>>>>getting their IP address, but I also want the domaine name.
>>>>>>Thanks,
>>>>>>-Michael
>>>>>
>>>>>how about:
>>>>>http://www.php.net/manual/en/function.gethostbyaddr.php
>>>>>
>>>>>Carl.
>>>>
>>>>It may be just me, but that is the first think I tried and it gave me an
>>>>IP
>>>>address not a domain name.
>>>>Maybe it's the... "or a string containing the unmodified ip_address on
>>>>failure"... that is getting me.
>>>>-Michael
>>>
>>>er you want to do a reverse dns lookup?
>>>Thats fraught with issues.
>>>
>>>--
>>>Hardware, n.: The parts of a computer system that can be kicked
>>>
>>>The best way to get the right answer on usenet is to post the wrong one.
>>>
>>
>>
>> I'm not sure what you mean, when I type "NSLookup 70.98.111.52"
>> at the command prompt I get back "Name: box52.bluehost.com"
>> It works instantally and it works every time (that I have tried.)
>> I want to get that same answer via PHP.
>>
>>
>>
>>
>
> FWIW, the statement < echo gethostbyaddr("70.98.111.52"); > prints
> "box52.bluehost.com" for me.
>
> I am not aware of any real reason that reverse dns lookups should be
> considered "fraught with issues". You must keep in mind however that all
> IP addresses do not have public dns records, and dns servers are often
> 'creatively' configured.
>
> Carl.
>
It must be the way I am doing it then because I have had the same results on
three web hosts in three countries.
AsiaHost, OnlyWebHosting, and BlueHost.
Here is what I did....
$domain=gethostbyaddr($REMOTE_ADDR);
print "<p align=\"center\">$domain</p>\n";
I just tried a fixed IP of Microsoft $domain=GetHostByAddr("207.46.20.30");
and that didn't work either.
-Michael
Navigation:
[Reply to this message]
|