Skip site navigation (1)Skip section navigation (2)
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
--==========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
<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}`;=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==========--




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