Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2008 22:13:54 -0500
From:      Jeffrey Goldberg <jeffrey@goldmark.org>
To:        Paul Schmehl <pauls@utdallas.edu>
Cc:        FreeBSD Questions <questions@freebsd.org>
Subject:   Re: How to use dig with an ip list
Message-ID:  <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org>
In-Reply-To: <F00086DB609A849EAB40A058@Macintosh.local>
References:  <F00086DB609A849EAB40A058@Macintosh.local>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52CC1A3B-5826-4E06-9325-0E43E5A58E78>