note 58015 added to function.gethostbyname
| From: | mcgrof at gmail dot com | Date: | Fri, 21 Oct 2005 16:05:36 +0000 |
| Subject: | note 58015 added to function.gethostbyname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97358@lists.php.net to get a copy of this message | ||
In PHP4 you can use gethostbyname() but I have found this unreliable when doing lookups on entries
that return A records on the private network. PHP5 has a much better routine -- dns_get_record(). If
you are stuck with PHP4 or don't want to upgrade you can use dig:
<?php
$ip =
/usr/bin/dig $host A +short;
?>
----
Manual Page -- http://www.php.net/manual/en/function.gethostbyname.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58015
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58015&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58015&report=yes
Search -- http://master.php.net/manage/user-notes.php