in reply to Adding an nslookup to a log script

An aside on efficiency whichever of the above approaches you take: you'll probably want to cache results (either manually with a hash or by using something like Memoize) to cut down on the DNS traffic you generate and to reduce the running time to get results out (e.g. if you save the results externally in a DBM file with Memoize the next time you run it'll only need to lookup new addresses seen since the last run).