Bug #12678 Updated: gethostbyname returns hostname instead of adresss

From: Date: Thu, 09 Aug 2001 20:13:52 +0000
Subject: Bug #12678 Updated: gethostbyname returns hostname instead of adresss
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-62736@lists.php.net to get a copy of this message
ID: 12678 User updated by: bobsledbob@yahoo.com Reported By: bobsledbob@yahoo.com Old Status: Feedback Status: Open Bug Type: Network related Operating System: Linux 2.2.16-22 PHP Version: 4.0.6 New Comment: > Can you access the internet from a browser? Yes, I can resolve any hostname using nslookup, host, etc. This machine accesses the internet just fine. ie. from the command line: [hydro@mail htdocs]$ host calc.intershipper.net calc.intershipper.net is a nickname for www.intershipper.net www.intershipper.net has address 216.58.153.11 [hydro@mail htdocs]$ but from PHP <?php echo gethostbyname ("calc.intershipper.net"); ?> calc.intershipper.net > Make sure your nameserver's are setup correctly. To the best of my knowledge, they are. Previous Comments: ------------------------------------------------------------------------ [2001-08-09 16:02:33] alindeman@php.net Can you access the internet from a browser? gethostbyname() returns the hostname when it can't find the IP (invalid address.) Make sure your nameserver's are setup correctly. ------------------------------------------------------------------------ [2001-08-09 15:57:51] bobsledbob@yahoo.com I'm having a problem where gethostbyname is returning the hostname not the IP address. Resolving hosts works fine on the command line with nslookup, host, etc. This is the exact problem as bug #8856. Andy said it should be resolved in 4.06, but I'm having problems. Thanks. Adam ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12678&edit=1

« previous php.dev (#62736) next »