How to use dig with an ip list

RW fbsd06 at mlists.homeunix.com
Tue Aug 19 03:33:51 UTC 2008


On Mon, 18 Aug 2008 21:03:36 -0500
Paul Schmehl <pauls at utdallas.edu> 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?

You could pipe it through:

  while read ip;do echo "${ip} `dig +short -x ${ip}`";done




More information about the freebsd-questions mailing list