When I wrote a domain searcher script what I did was filter first by names that return are resolvable, and then whois the remainder. Reduces load on the dependent whois server whose terms of service usually say "don't run scripts against me"
That's exactly the approach I tried to suggest: Find as many correct replies first, because there certainly are hosts which names can be resolved and try the whois-approach on everything else.