|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41795 checkdnsrr does not support DNS_TXT type
Submitted: 2007-06-25 08:59 UTC Modified: 2007-06-26 11:05 UTC
From: lucas at facebook dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2007-06-25 (CVS) OS: fedora fc5
Private report: No CVE-ID: None
 [2007-06-25 08:59 UTC] lucas at facebook dot com
Although you can use dns_get_record to get the contents of the TXT record you cannot use checkdnsrr or dns_check_record to see if the record exists. This could be useful for checking against a DNSBL

Reproduce code:
checkdnsrr('', "TXT");

Expected result:
E_WARNING: checkdnsrr(): Type 'TXT' not supported

Actual result:

The following patch enables the TXT_TYPE:

Index: dns.c
RCS file: /repository/php-src/ext/standard/dns.c,v
retrieving revision
diff -u -r1. dns.c
--- dns.c 14 May 2007 11:33:34 -0000
+++ dns.c 25 Jun 2007 08:52:59 -0000
@@ -290,6 +290,7 @@
      else if (!strcasecmp("ANY",   Z_STRVAL_PP(arg2))) type = DNS_T_ANY;
      else if (!strcasecmp("SOA",   Z_STRVAL_PP(arg2))) type = DNS_T_SOA;
      else if (!strcasecmp("CNAME", Z_STRVAL_PP(arg2))) type = DNS_T_CNAME;
+     else if (!strcasecmp("TXT",   Z_STRVAL_PP(arg2))) type = DNS_T_TXT;
      else if (!strcasecmp("AAAA",  Z_STRVAL_PP(arg2))) type = DNS_T_AAAA;
      else if (!strcasecmp("SRV",   Z_STRVAL_PP(arg2))) type = DNS_T_SRV;
      else if (!strcasecmp("NAPTR", Z_STRVAL_PP(arg2))) type = DNS_T_NAPTR;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 09:00 UTC] lucas at facebook dot com
Sorry, swapped expected and actual result :)
 [2007-06-26 11:05 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:25 2019 UTC