Hi @smilingraccoon, I don't full understand the problem because the DNS look ups will be launched against the DNS server used by the metasploit machine, right?  

In the worst case, I dont think its a common case to have the DNS server in the same machine than the web server one. Even if it's the case the requests to the DNS of the target will come from the DNS infraestructure, not from the metasploit machine, right?

Sorry I dont see a real advantage in doing the DNS lookup from the wordpress site, and the code would be easier and more beautiful using the AddressRange capabalities.

Maybe I'm forgetting something, please feel free to correct me :) On the other if more experienced developers are comfortable with this code, its right for me of course :) just sharing my opinion.