Bug #8754 Updated: gethostbyname() fails
| From: | sniper@php.net | Date: | Fri, 10 Aug 2001 00:38:16 +0000 |
| Subject: | Bug #8754 Updated: gethostbyname() fails | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62762@lists.php.net to get a copy of this message | ||
ID: 8754
Updated by: sniper
Reported By: jonny@1409.org
Status: Feedback
Bug Type: Network related
Operating System: Linux 2.2.16 (RH7)
PHP Version: 4.0.4pl1
New Comment:
First, update to PHP 4.0.6.
Then try both gethostbyname() and gethostbynamel()
to see if either works.
--Jani
Previous Comments:
------------------------------------------------------------------------
[2001-07-22 16:03:02] andy@php.net
Ooops, I read that too fast. Ok, so it works on the command
line, but not in PHP. Does this still happen in the current
version?
------------------------------------------------------------------------
[2001-07-21 21:03:44] andy@php.net
Please make sure that you're DNS server is setup correctly
and you have access to it and the internet. Try running
"netconfig" as root from a prompt. Also, try running
linuxconf and make sure the order in which hostnames are
setup is correct (i recommend "hosts,dns")
Also, try upgrading to the latest version of PHP.
------------------------------------------------------------------------
[2001-01-17 03:53:54] jonny@1409.org
When trying to resolv the ip address of a hostname given in /etc/hosts, gethostbyname() works fine.
It does NOT work when trying to resolv an ip address which must be looked up via the DNS server
though. In the latter case, gethostbyname($hostname) always returns $hostname, i.e. it
behaves like the hostname does not exist. However, doing a command line nslookup, the hostname is
found, so it DOES exist.
The problem occurs with version 4.0.4pl1 (compiled on the target system) as well as with version
4.0.1pl2 that comes with RedHat 7.0. I'm using kernel version 2.2.16 and a vanilla (i.e.
non-updated) RedHat 7.0.
Thanks in advance...
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=8754&edit=1