[PHP] IP Addesses on local network

2003-03-03 Thread Chris Blake
Greetings,

Th command 

echo gethostbyaddr(ip.number.inserted.here); 

returns the name of the server when it`s an internet address.
Is there a similar command that will return host names on a local
network

I tried using the above command putting in a LAN address, but it just
returned the IP address.

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] IP Addesses on local network

2003-03-03 Thread Dan Hardiker
 echo gethostbyaddr(ip.number.inserted.here);

 returns the name of the server when it`s an internet address.
 Is there a similar command that will return host names on a local
 network

 I tried using the above command putting in a LAN address, but it just
 returned the IP address.

This isn't a PHP issue, this is a DNS issue. gethostbyaddr uses DNS
resolution to convert the IP address into its named equivelant... if no
name is found, it will return the IP address again.

The only way to get the reverse DNS for a private (LAN) IP address is to
use a DNS server which has those IPs registered. In short, you have to run
your own domain name server and apply the entries in there.

There are other, OS independant, ways of adding these lookups (eg:
/etc/hosts on Unix %SYSTEMROOT%\system32\hosts.pam (I think) on Windows
2000+) but you will have to investigate those yourself.


-- 
Dan Hardiker [EMAIL PROTECTED]
ADAM Software  Systems Engineer
First Creative



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php