Menu
Hi
I have this in a function:
[code=php]
$hosts = gethostbynamel($domain);
if (is_array($hosts)) {
$IP = $hosts[0];
}
I’m fetching about 2 million $domain from a database and want to get the ip of the domain. Sometimes the domain is just garbage for example “yhujgga”, or even a IP-address.
The gethostbynamel() seems to take a while sometimes, as I guess a dns-lookup (it is a dns-lookup?) would do. Are there any faster ways of getting the ip of a domain (well, a domain in most cases, sometimes just garbage)? Naturally the above would take a while on 2 million domain names, and I really would like to speed it up…
Thanks
Lubox