#!/bin/perl -w use strict; use Socket; my ($domain, $wordlist) = @ARGV; $| = 1; $SIG{CHLD} = 'IGNORE'; my $childs = 10; my $i = 0; open (WL,$wordlist); while() { chomp($_); my $packed = inet_aton($_.$domain); if(defined($packed)) { if (fork == 0) { my $ip = inet_ntoa($packed); print "$_.$domain resolves to $ip\n"; } else { $i++; if($i >= $childs) { for(1..$childs) { wait(); $i--; } } } } else { next; } }