#41795 [Opn->Csd]: checkdnsrr does not support DNS_TXT type
| From: | tony2001@php.net | Date: | Tue, 26 Jun 2007 11:05:03 +0000 |
| Subject: | #41795 [Opn->Csd]: checkdnsrr does not support DNS_TXT type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114254@lists.php.net to get a copy of this message | ||
ID: 41795
Updated by: tony2001@php.net
Reported By: lucas at facebook dot com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: fedora fc5
PHP Version: 5CVS-2007-06-25 (CVS)
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-06-25 09:00:23] lucas at facebook dot com
Sorry, swapped expected and actual result :)
------------------------------------------------------------------------
[2007-06-25 08:59:29] lucas at facebook dot com
Description:
------------
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('1.1.168.192.my.abusebl.net', "TXT");
Expected result:
----------------
E_WARNING: checkdnsrr(): Type 'TXT' not supported
Actual result:
--------------
1
The following patch enables the TXT_TYPE:
Index: dns.c
===================================================================
RCS file: /repository/php-src/ext/standard/dns.c,v
retrieving revision 1.70.2.7.2.4
diff -u -r1.70.2.7.2.4 dns.c
--- dns.c 14 May 2007 11:33:34 -0000 1.70.2.7.2.4
+++ 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;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41795&edit=1