php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79561 dns_get_record() fails with DNS_ALL
Submitted: 2020-05-03 17:48 UTC Modified: 2020-05-04 14:29 UTC
From: anrdaemon at yandex dot ru Assigned: cmb (profile)
Status: Closed Package: *Network Functions
PHP Version: 7.4.5 OS: Windows
Private report: No CVE-ID: None
 [2020-05-03 17:48 UTC] anrdaemon at yandex dot ru
Description:
------------
It seems, the DNS_CAA resource record is not supported by Windows builds.

Excluding DNS_CAA from DNS_ALL results in successful query.

I think, if library does not support specific RR directly, the relevant bit should be removed from DNS_ALL.


Additionally:

Attempting a raw query with RR=257 results in empty response even if relevant record exists.

F.e. google.com:

> nslookup -type=CAA google.com.
Server:         192.168.1.12
Address:        192.168.1.12#53

Non-authoritative answer:
google.com      rdata_257 = 0 issue "pki.goog"

Authoritative answers can be found from:
google.com      nameserver = ns4.google.com.
google.com      nameserver = ns3.google.com.
google.com      nameserver = ns1.google.com.
google.com      nameserver = ns2.google.com.
ns1.google.com  internet address = 216.239.32.10
ns2.google.com  internet address = 216.239.34.10
ns3.google.com  internet address = 216.239.36.10
ns4.google.com  internet address = 216.239.38.10


> php -r 'print_r(dns_get_record("google.com", 257, $x, $y, true));'
Array
(
)

Possible related: https://bugs.php.net/bug.php?id=52260

Test script:
---------------
<?php

$rr = dns_get_record("www.php.net", DNS_ALL);// & ~DNS_CAA);
print_r($rr);


Expected result:
----------------
A resulting array or false is returned. Silently!

Actual result:
--------------
PHP Warning:  dns_get_record(): Type '251721779' not supported in …

Excluding DNS_CAA from DNS_ALL results in successful query.

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-04 13:53 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-05-04 13:53 UTC] cmb@php.net
Apparently, commit 280e9cb[1] missed to update dns_win32.c.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=280e9cb28d07a69e56ebcde4c368f3053298abe3>
 [2020-05-04 14:29 UTC] cmb@php.net
> I think, if library does not support specific RR directly, the
> relevant bit should be removed from DNS_ALL.

Yes, that's actually the problem, since MSVC runtimes do not yet
support CAA records.
 [2020-05-04 14:46 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #79561: dns_get_record() fails with DNS_ALL
On GitHub:  https://github.com/php/php-src/pull/5524
Patch:      https://github.com/php/php-src/pull/5524.patch
 [2020-05-04 21:03 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c40a494406aa3606be964b24d224ec4eb0c936e8
Log: Fix #79561: dns_get_record() fails with DNS_ALL
 [2020-05-04 21:03 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC