php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70473 dns_get_record - Server error for any of DNS_A|DNS_AAAA bubbles up, no result
Submitted: 2015-09-11 08:46 UTC Modified: 2025-03-01 16:49 UTC
Votes:5
Avg. Score:3.6 ± 1.2
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: sjon at hortensius dot net Assigned: bukka (profile)
Status: Assigned Package: Network related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
7 + 27 = ?
Subscribe to this entry?

 
 [2015-09-11 08:46 UTC] sjon at hortensius dot net
Description:
------------
When fetching multiple records using dns_get_record; if any of the records return a SERVFAIL; that failure bubbles up; and no result gets returned.

To reproduce this you need a specifically failing dns-server but it's also obvious from the code.

I'd expect an array (with single result) instead of an error when the domain has an A record, but returns a SERVFAIL for AAAA

Test script:
---------------
dns_get_record('domain', DNS_A | DNS_AAAA);

Expected result:
----------------
array(
...
)

Actual result:
--------------
dns_get_record(): A temporary server error occurred. in Command line code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2025-03-01 16:49 UTC] bukka@php.net
-Type: Bug +Type: Feature/Change Request -Assigned To: +Assigned To: bukka
 [2025-03-01 16:49 UTC] bukka@php.net
I thought about this and I will changes it to feature as we cannot really change this in the bug fixing version due to possible BC break. This is really just about improving the error handling so I added proposed solution to https://github.com/php/php-src/issues/17919
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 09:01:26 2025 UTC