|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-09-23 14:36 UTC] walter at oradio dot be
Description: ------------ [regression] dns_get_record does not return false on dns server failure When doing a nslookup for this domain: radioantwerpen.be the response is: ;; Got SERVFAIL reply from 83.149.80.123, trying next server Server: 83.149.80.123 Address: 83.149.80.123#53 ** server can't find radioantwerpen.be: NXDOMAIN Note: ----- This worked on PHP version 5.5x, but when I upgraded to 5.6.26 this error occurred. The same error occurs on the production server, which is a different machine with a different OS, but same PHP version. This is a regression from bug: #53092 ( https://bugs.php.net/bug.php?id=53092 ) . It was closed in 2014. Test script: --------------- $url = "radioantwerpen.be"; $result = dns_get_record($url); print_r($result); Expected result: ---------------- return empty array Actual result: -------------- throws "Warning: dns_get_record(): A temporary server error occurred. in ..." and returns nothing (no array) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 13:00:01 2025 UTC |
This error is due to the fact that the default value for the $type argument is DNS_ANY, which is ignored by most DNS servers. dns_get_record('radioantwerpen.be') doesn't work, but dns_get_record('radioantwerpen.be', DNS_A) does. Source: https://dustri.org/b/a-short-tale-on-phps-dns_get_record.htmlI get this error when asking duckdns dor dynamic lookup that fails Warning:"A temporary server error occurred" if php has flag show all this will show as an error with E_WARNING status this is my workaround: function NoWarnings($errno, $errstr, $errfile, $errline){ return true; } $oldhandler = set_error_handler('NoWarnings', E_WARNING ); $dns = dns_get_record( $dnsname ); set_error_handler( $oldhandler, E_WARNING ); @ does not supress the Warning