|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65343 Not all DNS types supported in dns_get_record
Submitted: 2013-07-26 13:34 UTC Modified: 2021-08-30 14:37 UTC
Avg. Score:3.5 ± 1.8
Reproduced:4 of 5 (80.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: info at tvdw dot eu Assigned:
Status: Analyzed Package: Network related
PHP Version: 5.5.1 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: info at tvdw dot eu
New email:
PHP Version: OS:


 [2013-07-26 13:34 UTC] info at tvdw dot eu
For a little project I'm working on I need DNS_DS (43) and DNS_TLSA (52) support in dns_get_record, but these are currently not supported by PHP, together with a lot of other DNS records. Manually defining these constants to the correct DNS RRtype values gives the warning "dns_get_record(): Type .. not supported".

Test script:
$ds_record = dns_get_record('com', DNS_DS);
echo $ds_record['hash'];

Expected result:

Actual result:
Notice: Use of undefined constant DNS_DS - assumed 'DNS_DS' in ...
Warning: dns_get_record() expects parameter 2 to be long, string given in ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-26 23:18 UTC]
-Status: Open +Status: Analyzed
 [2013-07-26 23:18 UTC]
It seems PHP only supports following values.

php > array_walk(get_defined_constants(), function($v, $k) {if 
(preg_match('/^DNS/', $k)) echo $k.' = '.$v.PHP_EOL;} );
DNS_A = 1
DNS_NS = 2
DNS_SOA = 32
DNS_PTR = 2048
DNS_HINFO = 4096
DNS_MX = 16384
DNS_TXT = 32768
DNS_SRV = 33554432
DNS_NAPTR = 67108864
DNS_AAAA = 134217728
DNS_A6 = 16777216
DNS_ANY = 268435456
DNS_ALL = 251713587

while there are

We are missing many.
 [2013-07-26 23:20 UTC]
-Type: Feature/Change Request +Type: Bug
 [2013-07-26 23:20 UTC]
This may be typed as bug.
 [2019-07-15 16:06 UTC] daniil at daniil dot it
Raw mode can be used along with a DNS record parser to fetch DNS records of any type.
I've just created a small lib that does just this, if anyone's interested:
 [2021-08-30 14:37 UTC]
-Type: Bug +Type: Feature/Change Request
 [2021-08-30 14:37 UTC]
> Raw mode can be used along with a DNS record parser to fetch DNS
> records of any type.

Indeed.  So changing back to feature request.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 16:01:29 2024 UTC