phppcntlgethostbyaddr

Resolving a large amount of IP addresses with PHP


I need to resolve a large amount of IP addresses. I'm using gethostbyaddr() for it.

I just recently read about using pcntl_fork() and that if you do fork, you don't have to wait for a timeout.

Since gethostbyaddr will take a long time (30 seconds, I think) to resolve a host before timeout, is pcntl_fork practical for use with a large amount of IP addresses?


Solution

  • You want a high-performance, asynchronous DNS library for PHP. Fortunately, Net_DNS2 is exactly that.