Bug #76966 [NEW]: checkdnsrr function return inconsistent results
| From: | stephane at dubishere dot com | Date: | Wed, 03 Oct 2018 16:25:58 +0000 |
| Subject: | Bug #76966 [NEW]: checkdnsrr function return inconsistent results | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-217394@lists.php.net to get a copy of this message | ||
From: stephane at dubishere dot com
Operating system: Ubuntu 18.04
PHP version: 7.2.10
Package: *General Issues
Bug Type: Bug
Bug description:checkdnsrr function return inconsistent results
Description:
------------
---
From manual page: http://www.php.net/function.checkdnsrr
---
Root issue: I'm having networking problems when setting up the session
handler to use Redis.
If I setup the session handler using an IP address pointing to my Redis
host, it works fine. If I use a domain (DNS or my linux /etc/hosts file)
it doesn't work, sessions are not saved in Redis.
So i've started looking into some networking related function to test
this behaviour and see if I could find a DNS-related issue somewhere,
and here I've encountered weird results for checkdnsrr() function.
Hopefully, fixing these would fix my Redis connection issue.
Test script:
---------------
/**
In AWS using route53, I've set 2 DNS records:
- one A record route53.myapp.com >> 10.1.1.101
- one CNAME record route666.myapp.com >> route53.myapp.com
*/
// >> control the OS/hosts is seeing the DNS records:
var_dump( gethostbyname('route53.myapp.com')); >> 10.1.1.101
var_dump( gethostbyname('route666.myapp.com')); >> 10.1.1.101
// My first test:
var_dump( checkdnsrr('route53.myapp.com', 'A')); >> true
var_dump( checkdnsrr('route53.myapp.com')); >> false !!!
### If I have a A record, looking for ANY type of records should return
true too.
// My second test:
var_dump( checkdnsrr('route666.myapp.com')); >> true
var_dump( checkdnsrr('route666.myapp.com', 'A')); >> true !!!
var_dump( checkdnsrr('route666.myapp.com', 'CNAME')); >> true
### If route666 is a CNAME, testing it's a A record should return false.
--
Edit bug report at https://bugs.php.net/bug.php?id=76966&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76966&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76966&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76966&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76966&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76966&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76966&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76966&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76966&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76966&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76966&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76966&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76966&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76966&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76966&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76966&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76966&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76966&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76966&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76966&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76966&r=mysqlcfg