Jump to content

Timeout/Fatal error issues with Pear NET DNS


shelluk

Recommended Posts

I hope I've chosen the right forum. If not I apologise.

 

I was wondering if any one could help me come up with a way round this. As I'm struggling to do so.

 

I get the following error:

Fatal error: Maximum execution time of 60 seconds exceeded in D:\xampp\php\PEAR\Net\DNS\Resolver.php on line 996

 

This is a result of the line:

$resultC = $resolverC->query($domain,'mx');

 

From this code:

$resolverC = new Net_DNS_Resolver();				
// use domains own namservers to look up
// $nss is an array of the nameservers for the domain 
// which we are looping through one at a time
$resolverC->nameservers = array($nss[$x]);
$resultC = $resolverC->query($domain,'mx');

 

I know why I get this error but how do I get around it so my page finishes executing gracefully and returns a friendly error?

 

I get it because that nameserver doesn't respond to requests for one reason or another, and times out.

 

Example of what happens with the same request when you do it with nslookup to demonstrate the problem:

C:\>nslookup
Default Server:  dc01.company.local
Address:  192.168.1.1

> server ns1.xyzcompany.com
Default Server:  ns1.xyzcompany.com
Address:  194.123.123.123

> xyzcompany.com
Server:  ns1.xyzcompany.com
Address:  194.123.123.123

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** Request to ns1.xyzcompany.com timed-out

 

Thanks for your help,

Shell

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.