Bug #68081 [NEW]: checkdnsrr( 'example.com' ) returns `true` when no MX, only CNAME
| From: | figureonecpr at gmail dot com | Date: | Tue, 23 Sep 2014 03:52:27 +0000 |
| Subject: | Bug #68081 [NEW]: checkdnsrr( 'example.com' ) returns `true` when no MX, only CNAME | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187674@lists.php.net to get a copy of this message | ||
From: figureonecpr at gmail dot com
Operating system: Linux Phoenix 2.6.32
PHP version: master-Git-2014-09-23 (snap)
Package: Network related
Bug Type: Bug
Bug description:checkdnsrr( 'example.com' ) returns
true when no MX, only
CNAME
Description:
------------
Per http://php.net/manual/en/function.checkdnsrr.php,
checkdnsrr()
defaults to an MX record query when the second argument is not supplied.
Regardless of SMTP's implicit MX logic, this function is supposed to
return false if $host does not have at least one *explicit* MX in the
DNS.
However, if the supplied hostname simply has a CNAME record (a good
CNAME, one that can be dereferenced to an extant canonical hostname) the
function returns true.
The bug is seen regardless of whether the canonical hostname itself has
an MX record. For example, if you have somehost.example.com CNAME -->
example.com A and do checkdnsrr( 'somehost.example.com' ) you will get
true. But if you go straight to the canonical A record and do
checkdnsrr( 'example.com' ) you will get false.
Test script:
---------------
// where cname.example.com exists is a CNAME in the DNS pointing to an
extant canonical hostname
var_dump( checkdnsrr( 'cname.example.com' ) );
Expected result:
----------------
boolean(false)
Actual result:
--------------
boolean(true)
--
Edit bug report at https://bugs.php.net/bug.php?id=68081&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68081&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68081&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68081&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68081&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68081&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68081&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68081&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68081&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68081&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68081&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68081&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68081&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68081&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68081&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68081&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68081&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68081&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68081&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68081&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68081&r=mysqlcfg