|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-07 06:32 UTC] corinl at gmx dot de
Hi,
try this:
echo(gethostbyname("gmx.de5"))
output is: 62.75.134.200
in fact, this domain doesn't exist, only gmx.de exists.
('host gmx.de5' on the server reports an error)
this behavior is bad when for example using getbyhostname to validate an email address, because an email send to someone@gmx.de5 would surely not arrive...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
With the following script: <?php $db = gethostbyname("gmx.de5"); var_dump($db); $db = gethostbyname("gmx.de"); var_dump($db); ?> Edin can't reproduce the problem under windows. Can you please try that script? You're saying that host gmx.de5 on the server reports an error but you're under windows and windows doesn't have 'host'... Are you sure your DNS is working fine? I'm getting 213.165.65.100 from gmx.de and not 62.75.134.200... gethostbyname() is also supposed to return the hostname on failure. At least thats what we (Edin and me) are getting under Windows and Linux/Unix. Thank you for your report.It's possible that your DNS is setup with a search domain that has a wildcard. I'd like you to try two things: 1) gethostbyname("gms.de5."); <--- does that return an IP address as well? (Note the trailing dot) 2) Check your TCP/IP Properties | Advanced Settings | DNS Tab | describe every single piece of information on this property sheet, give detail. Interrestingly there doesn't seem to be a revese lookup for 62.75.134.200...I've just seen the same problem on PHP 4.3.10/win32: <?php $db = gethostbyname("gmx.de"); var_dump($db); $db = gethostbyname("gmx.de5"); var_dump($db); $db = gethostbyname("gmx.de5."); var_dump($db); ?> returns string(14) "213.165.64.215" string(12) "216.82.79.97" string(12) "216.82.79.97" I'm not the server admin, just troubleshooting it remotely.<?php echo 'PHP '.phpversion()."\n"; $sdip = gethostbyname("slashdot.org"); $sddomain = gethostbyaddr($sdip); print "IP: $sdip\n"; print "Domain: $sddomain\n"; echo gethostbyname('totallyfake456jh47r.com')."\n"; echo gethostbyname('2.0.0.127.list.dsbl.org')."\n"; echo gethostbyname('972.79.82.216.list.dsbl.org')."\n"; echo gethostbyname('150.250.35.66.list.dsbl.org')."\n"; ?> returns: PHP 4.3.10 IP: 66.35.250.150 Domain: slashdot.org totallyfake456jh47r.com 127.0.0.2 216.82.79.97 216.82.79.97 All looks fine, exept the last two lines! It returns the server's IP address (216.82.79.97) when an entry is not listed in dsbl.org.