ID: 12678
Updated by: jimw
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Duplicate
Bug Type: Network related
Operating System: Linux 2.2.16-22
PHP Version: 4.0.6
New Comment:

duplicate of 13243. (yes, that's a later bug. but it documents the problem more 
concisely.)

Previous Comments:
------------------------------------------------------------------------

[2001-08-10 13:06:52] [EMAIL PROTECTED]

<?php
  $domain = "www.yahoo.com";
  echo gethostbyname($domain) . "<br>\n";
  print_r (gethostbynamel($domain));
?> 

www.yahoo.com
Array ()


As I've thought about this some, I believe I started having problems with this only 
after upgrading to 4.06.  It may have worked with 4.05 and I know it was working for 
me with 4.04plx   Maybe this has something to do with my Linux Disto?  I'm using 
RedHat 7.0

Thanks for your thoughts.  For now, I'm just hard coding the ip address I need, so 
it's not like this is bogging me down.

Adam


------------------------------------------------------------------------

[2001-08-09 21:51:12] [EMAIL PROTECTED]

Could you please try gethostbynamel() with the same 
hostname? 

(these both work for me just fine..)

--Jani


------------------------------------------------------------------------

[2001-08-09 16:13:52] [EMAIL PROTECTED]

> 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.



------------------------------------------------------------------------

[2001-08-09 16:02:33] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to