#34938 [Opn->Csd]: dns_get_record() returns strange results for long hostnames
ID: 34938
Updated by: tony2001@php.net
Reported By: php at ter dot dk
-Status: Open
+Status: Closed
Bug Type: Network related
Operating System: Linux 2.4 debian sarge
PHP Version: 5.1.0RC3
Assigned To: tony2001
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:
------------------------------------------------------------------------
[2005-10-25 05:32:15] php at ter dot dk
Sorry, still no dice with latest snapshot; php5-200510250230:
$ ~/dev/php5-200510250230/sapi/cli/php -r
'var_dump(dns_get_record("php.net",DNS_NS));'
array(4) {
[0]=>
array(5) {
["host"]=>
string(7) "php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[1]=>
array(5) {
["host"]=>
string(37) "\003ns2\007easydns\003com\000.php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[2]=>
array(5) {
["host"]=>
string(24) "\007remote1\192).php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[3]=>
array(5) {
["host"]=>
string(20) "\003ns1\192).php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
}
- Peter Brodersen
------------------------------------------------------------------------
[2005-10-24 01:11:46] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Try next snapshot.
The snapshot you're trying doesn't include the patch yet.
------------------------------------------------------------------------
[2005-10-24 01:05:51] php at ter dot dk
I think we have a major regression in latest snaps (same result in
php5-200510232030 and php5-200510232230) where the return values are
pretty strange for any host checked, even short hosts, e.g.:
$ ~/dev/php5-200510232230/sapi/cli/php -r
'var_dump(dns_get_record("php.net",DNS_MX));'
array(1) {
[0]=>
array(6) {
["host"]=>
string(7) "php.net"
["type"]=>
string(2) "MX"
["pri"]=>
int(19)
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65537)
}
}
$ ~/dev/php5-200510232230/sapi/cli/php -r
'var_dump(dns_get_record("php.net",DNS_A));'
array(1) {
[0]=>
array(5) {
["host"]=>
string(7) "php.net"
["type"]=>
string(1) "A"
["ip"]=>
string(10) "0.4.64.246"
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
}
$ ~/dev/php5-200510232230/sapi/cli/php -r
'var_dump(dns_get_record("php.net",DNS_NS));'
array(4) {
[0]=>
array(5) {
["host"]=>
string(7) "php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[1]=>
array(5) {
["host"]=>
string(37) "\003ns2\007easydns\003com\000.php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[2]=>
array(5) {
["host"]=>
string(20) "\003ns1\192).php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
[3]=>
array(5) {
["host"]=>
string(24) "\007remote1\192).php.net"
["type"]=>
string(2) "NS"
["target"]=>
string(0) ""
["class"]=>
string(2) "IN"
["ttl"]=>
int(65536)
}
}
It seems like there is some kind of offset error (e.g. octet 1 and 2 in
the IP address for the A lookup is presented as octet 3 and 4)
On the lighter side the long hostnames behave in the new way as well.
I'm sorry if I'm just impatient.
- Peter Brodersen
------------------------------------------------------------------------
[2005-10-23 20:35:32] tony2001@php.net
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.
------------------------------------------------------------------------
[2005-10-21 05:14:48] php at ter dot dk
Please be aware of line breaks added by the bug system.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34938
--
Edit this bug report at http://bugs.php.net/?id=34938&edit=1
Thread (8 messages)