#27163 [Opn->Bgs]: gethostbyname() returns server IP for non-existent hosts

From: Date: Fri, 06 Feb 2004 02:26:01 +0000
Subject: #27163 [Opn->Bgs]: gethostbyname() returns server IP for non-existent hosts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54489@lists.php.net to get a copy of this message
ID: 27163 Updated by: iliaa@php.net Reported By: turtle at rawx dot net -Status: Open +Status: Bogus Bug Type: Network related Operating System: Linux 2.4.24 PHP Version: 4.3.5RC2 New Comment: It works fine here, when it fails to resolve the original domain string is returned. If you get anything else it could be due to named issues on your system. Previous Comments: ------------------------------------------------------------------------ [2004-02-05 15:13:09] turtle at rawx dot net Description: ------------ gethostbyname() is returning my own IP address for non-existent domain names. The expected behavior is that it will return the original name back to you. Resolving a real domain returns it's correct IP address. This issue affects other DNS resoluton commands too... for example, checkdnsrr('totallyfake456jh47r.com','A') returns TRUE. Using local resolution commands, the expected result (NXDOMAIN) is returned: /:~# host totallyfake456jh47r.com Host totallyfake456jh47r.com not found: 3(NXDOMAIN) This may similar (same?) as bug ID <a href='http://bugs.php.net/bug.php?id=21487&edit=2'>21487</a>. PHP configuration: ./configure --with-apxs2=/www/bin/apxs --with-config-file-path=/etc --with-mcrypt --enable-ftp --with-gd=/usr/local --with-zlib-dir=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-mysql --with-xml --enable-track-vars Reproduce code: --------------- echo gethostbyname('totallyfake456jh47r.com'); Expected result: ---------------- totallyfake456jh47r.com Actual result: -------------- 66.166.160.74 (my server's own IP) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27163&edit=1

« previous php.bugs (#54489) next »