From owner-freebsd-questions@FreeBSD.ORG Sun Jan 14 21:23:16 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B07D016A417 for ; Sun, 14 Jan 2007 21:23:16 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 75AC913C44B for ; Sun, 14 Jan 2007 21:23:16 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.8) id l0ELNFoF020986; Sun, 14 Jan 2007 15:23:15 -0600 (CST) (envelope-from dan) Date: Sun, 14 Jan 2007 15:23:15 -0600 From: Dan Nelson To: Grant Peel Message-ID: <20070114212314.GF46272@dan.emsphone.com> References: <007e01c737d7$20573170$6501a8c0@GRANT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <007e01c737d7$20573170$6501a8c0@GRANT> X-OS: FreeBSD 6.2-PRERELEASE User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-questions@freebsd.org Subject: Re: Identifying a Remote Machine. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2007 21:23:16 -0000 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@allantgroup.com