Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 1997 09:33:58 +0930 (CST)
From:      grog@FreeBSD.ORG
To:        andrew@ugh.net.au
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: netstat and long hostnames
Message-ID:  <199707290003.JAA02683@freebie.lemis.com>
In-Reply-To: <Pine.BSF.3.96.970729041700.14612A-100000@depravitas.tuu.utas.edu.au> from "andrew@ugh.net.au" at "Jul 29, 97 04:18:47 am"

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707290003.JAA02683>