Identifying a Remote Machine.

Dan Nelson dnelson at allantgroup.com
Sun Jan 14 21:23:16 UTC 2007


In the last episode (Jan 14), Grant Peel said:
> I have several servers, each with hundreds of IPs on them.
>
> I am attempting to write a php script that will connect to each ip
> and identify the 'hostname' as set in rc.conf.
> 
> I have been looking at icmp, env etc, and can't find a method. I was
> also loioking at ping, but it does not show the hostname.
> 
> The only reply I need from the server is the hostname. That will tell
> ne that the IP is live and what machine its on.

If they're not jailed, just connect to the SMTP port.  sendmail's
banner has the hostname in it.

Another option, if you have a machine on the same subnet as your
targets, would be to ping each one, then compare the MAC addresses to
determine which ones are on the same host as each other.

Or, if you have login access to the servers, just run "ifconfig -a" to
list the IPs.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list