Just reiterating what someone said in the manual...
"Be cautious when looking up many hostnames. If your DNS server is slow to
respond, you may have to pump up your Max execution time for your scripts,
otherwise, it will timeout. I found that even 3 unresolvable hosts can
cause a 30 second delay in processing.
"
If you're going to run multiple ips through that function, even if it does work, that may not be the best direction to go.