From owner-freebsd-questions@FreeBSD.ORG Tue Aug 19 03:30:57 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 9E347106564A for ; Tue, 19 Aug 2008 03:30:57 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 7D01E8FC17 for ; Tue, 19 Aug 2008 03:30:57 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 8B52615A42E; Mon, 18 Aug 2008 23:13:56 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 18 Aug 2008 23:13:56 -0400 X-Sasl-enc: wa1wldZVrZ77xu7FJ1PHZ8NwbHws9MSUj/vwBBJgaFJT 1219115636 Received: from hagrid.ewd.goldmark.org (n114.ewd.goldmark.org [72.64.118.114]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2D8C23ABD4; Mon, 18 Aug 2008 23:13:56 -0400 (EDT) Message-Id: <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org> From: Jeffrey Goldberg To: Paul Schmehl In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Date: Mon, 18 Aug 2008 22:13:54 -0500 References: X-Mailer: Apple Mail (2.928.1) Cc: FreeBSD Questions 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:30:57 -0000 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 Better might be to use something in p5-net-DNS so that you don't make N separate calls to dig. Cheers, -j -- Jeffrey Goldberg http://www.goldmark.org/jeff/