Help scripting dns lookup using awk

Polytropon freebsd at
Fri Sep 15 13:44:34 UTC 2017

On Fri, 15 Sep 2017 14:30:19 +0100, RW via freebsd-questions wrote:
> On Thu, 14 Sep 2017 20:55:00 -0400
> Ernie Luzar wrote:
> > The following sh script works, but runs very slow.
> Almost certainly the reason it's slow is that you are doing sequential
> synchronous lookups. Switching  to another language isn't going help
> much. To speed it up you either need to switch to a language with a
> DNS library that supports asynchronous lookups or fire-off parallel
> child processes. The latter is easier.

Correct. The bottleneck is is sequential calls to "host <parameters>".
Separating the input, for example per TLD, and then executing the
queries in parallel could help. It's also possible to use IP ranges
for separation. However, only actual testing will reveal which
approach works best. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list