PDA

View Full Version : hostname is diplaying IP address



tommy916
05-28-2003, 04:50 PM
I didn't know that 1.6 has new hostname added.
but the hostname displays the ip address. I don't know if this only happen for Win server.
I looked in mysql database and see the IP address instead of hostname in Hostname table.




<?php echo $REMOTE_HOST; ?>
<?php echo $HTTP_SERVER_VARS["REMOTE_HOST"]; ?>
<?php echo $_SERVER["REMOTE_HOST"]; ?>

I tried all above but it shows IP addresss.

TurnkeyAdmin
05-29-2003, 01:41 AM
That is a apache or IIS problem. You need to fix the setting within your web server.

tommy916
05-29-2003, 02:05 PM
Problem solved... from
http://www.php.net/manual/en/function.gethostbyaddr.php


$hostname = @gethostbyaddr($_SERVER['REMOTE_ADDR']);

TurnkeyAdmin
05-30-2003, 02:55 AM
That will work too. :D

mvlf
06-27-2003, 03:53 AM
I am still with the same problem...
Using :
$REMOTE_HOST; or
$HTTP_SERVER_VARS [REMOTE_HOST "]; or
$_SERVER [REMOTE_HOST "];

I received the message of Unavailable

Using the function:

gethostbyaddr($_SERVER['REMOTE_ADDR']);

now I get to receive IP. How to solve?

TurnkeyAdmin
06-27-2003, 11:30 AM
Most likely you need to turn on hostname look ups in IIS or apache, whichever you are using.

tommy916
06-27-2003, 05:38 PM
I recommend that you do not use it. I decided to disable it. Most hosting disable it too. Because the reverse DNS lookup will slow down your website serioiusly. It did slow down my server 20 times than normal while it was trying to find the hostname for that IP address. You can look for more info about reverse dns lookup in search engine.

you can use other site for dns lookup like http://arin.net/ http://remote.12dt.com/rns/

rvining
08-01-2003, 06:51 AM
i understand that this is not a good idea but how do i turn it on in IIs?

TurnkeyAdmin
08-02-2003, 08:16 PM
I'm not familiare with IIS myswlf so I cant help.