From owner-freebsd-questions@FreeBSD.ORG Tue Aug 19 03:52:12 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD9EC10656A5 for ; Tue, 19 Aug 2008 03:52:12 +0000 (UTC) (envelope-from prvs=pauls=110ea086f@utdallas.edu) Received: from ip-relay-001.utdallas.edu (ip-relay-001.utdallas.edu [129.110.20.111]) by mx1.freebsd.org (Postfix) with ESMTP id A44BE8FC12 for ; Tue, 19 Aug 2008 03:52:12 +0000 (UTC) (envelope-from prvs=pauls=110ea086f@utdallas.edu) X-Group: RELAYLIST X-IronPort-AV: E=Sophos;i="4.31,320,1215406800"; d="scan'208";a="6935804" Received: from smtp3.utdallas.edu ([129.110.20.110]) by ip-relay-001.utdallas.edu with ESMTP; 18 Aug 2008 22:52:11 -0500 Received: from [192.168.2.102] (cpe-24-175-90-48.tx.res.rr.com [24.175.90.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id 7DD8A23DE8 for ; Mon, 18 Aug 2008 22:52:11 -0500 (CDT) Date: Mon, 18 Aug 2008 22:52:10 -0500 From: Paul Schmehl To: FreeBSD Questions Message-ID: In-Reply-To: <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org> References: <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========773893DFAA6B3571D9D9==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: How to use dig with an ip list 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: Tue, 19 Aug 2008 03:52:12 -0000 --==========773893DFAA6B3571D9D9========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --On August 18, 2008 10:13:54 PM -0500 Jeffrey Goldberg=20 wrote: > On Aug 18, 2008, at 9:03 PM, Paul Schmehl wrote: > >> I know I'm missing the obvious. I want to use an IP list to >> generate an ip+hostname list. IOW, I want to go from this: >> >> x.x.x.x >> y.y.y.y >> >> to this; >> >> x.x.x.x foo.domain.tld >> y.y..y.y bar.domain.tld >> >> What's the best/easiest way to do this? > > Easiest: > > $ for i in `cat ip-list`; do > > echo -n "$i " > > dig +short -x $i > > done > Don't know why I didn't think of that. I ended up using this: for ip in `cat public_linux_ips`; do echo ${ip} `dig +short -x ${ip}`;=20 done > public_linux_ips_resolved Which gave me the output I wanted. Thanks for the pointer. Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========773893DFAA6B3571D9D9==========--