From owner-freebsd-questions Mon Jul 28 17:04:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA14288 for questions-outgoing; Mon, 28 Jul 1997 17:04:11 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA14208; Mon, 28 Jul 1997 17:03:57 -0700 (PDT) Received: (grog@localhost) by freebie.lemis.com (8.8.6/8.6.12) id JAA02683; Tue, 29 Jul 1997 09:33:58 +0930 (CST) From: grog@FreeBSD.ORG Message-Id: <199707290003.JAA02683@freebie.lemis.com> Subject: Re: netstat and long hostnames In-Reply-To: from "andrew@ugh.net.au" at "Jul 29, 97 04:18:47 am" To: andrew@ugh.net.au Date: Tue, 29 Jul 1997 09:33:58 +0930 (CST) Cc: freebsd-questions@FreeBSD.ORG Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk andrew@ugh.net.au writes: > Hi, > > I'm sure there is a really easyway to do this but... > > When I do a netstat I get a list of hosts connected to my machine. I only > see the first 16 or so characters. If I wanted to find the entire hostname > or number how would I go about it? Yup, this one is a real pain. Somebody should extend the size of the field. In the meantime, you can get the full name with nslookup. For example, === grog@freebie (/dev/ttypa) ~ 5 -> netstat Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 0 gregl1.lnk.telst.1223 www.sofcom.com.a.http CLOSE_WAIT tcp 0 0 gregl1.lnk.telst.1222 www.sofcom.com.a.http CLOSE_WAIT === grog@freebie (/dev/ttypa) ~ 6 -> netstat -n Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 0 139.130.136.133.1223 203.9.191.65.80 CLOSE_WAIT tcp 0 0 139.130.136.133.1222 203.9.191.65.80 CLOSE_WAIT === grog@freebie (/dev/ttypa) ~ 7 -> nslookup Default Server: freebie.lemis.com Address: 0.0.0.0 > 139.130.136.133 Server: freebie.lemis.com Address: 0.0.0.0 Name: gregl1.lnk.telstra.net Address: 139.130.136.133 > 203.9.191.65 Server: freebie.lemis.com Address: 0.0.0.0 Name: www.sofcom.com.au Address: 203.9.191.65 Greg