Date: Mon, 18 Aug 2008 22:52:10 -0500 From: Paul Schmehl <pauls@utdallas.edu> To: FreeBSD Questions <questions@freebsd.org> Subject: Re: How to use dig with an ip list Message-ID: <C2F700D5D04999507E393C99@Macintosh.local> In-Reply-To: <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org> References: <F00086DB609A849EAB40A058@Macintosh.local> <52CC1A3B-5826-4E06-9325-0E43E5A58E78@goldmark.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--On August 18, 2008 10:13:54 PM -0500 Jeffrey Goldberg
<jeffrey@goldmark.org> 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}`;
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C2F700D5D04999507E393C99>
