|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73594 dns_get_record does not populate $additional out parameter
Submitted: 2016-11-23 19:47 UTC Modified: -
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: weirdan at gmail dot com Assigned:
Status: Closed Package: *Network Functions
PHP Version: 7.1.0RC6 OS: CentOS 7
Private report: No CVE-ID: None
 [2016-11-23 19:47 UTC] weirdan at gmail dot com
After upgrading from PHP 5.6.27 to 7.1.0RC6 dns_get_record stopped returning additional records in its out parameter. I've confirmed with tcpdump that PHP (libresolv I imagine) sends the same request as before, and gets the same answer (with additional records), yet $additional array in the following code is no longer populated.

Test script:
The actual code I'm trying to get working is:
$auth = [];
$additional = [];

var_dump(dns_get_record("_mysql._slave.service.consul", DNS_SRV, $auth, $additional), $auth, $additional);

However it depends on consul service discovery. 

Simpler reproduce script would be:
$auth = [];
$additional = [];

var_dump(count(dns_get_record("", DNS_ANY, $auth, $additional)), count($auth), count($additional));

Yet it requires known DNS server that returns additional records to be configured as your preferred recursor in /etc/resolv.conf (I used's authoritative DNS server below):

Expected result:
With script above, with resolv.conf configured as described there, running on PHP 5.6.27 I get:

int(8) <--- $additional is NOT empty

Actual result:
Running on PHP 7.1.RC6 (otherwise configured the same) I get:

int(0) <--- $additional IS empty


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-25 01:53 UTC] weirdan at gmail dot com
Fixed the bug, preparing tests and pull request. This bug affects PHP7.0.0+, but does not affect PHP5.6.*
 [2016-12-02 13:05 UTC] weirdan at gmail dot com
Is there anything else I can do to get this merged?
 [2016-12-18 19:55 UTC]
Automatic comment on behalf of
Log: Fixed bug #73594
 [2016-12-18 19:55 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 13:01:28 2024 UTC