How can I resolve a domain name to an IP address? : I need to resolve any given domain in PHP to its corresponding IP address. [`gethostbyname`][1] appears to perform a reverse DNS (rDNS) and isn't useful for obtaining the IP address of a domestic connection (that doesn't have direct rDNS).

I have the following, which of course doesn't work:

    <?php
    	if (ISSET($_POST["domain"])) {
    		require_once("/protected/db.php");
    		echo gethostbyname($_POST["domain"]);
    	}
    	echo "Error";
    ?>

How can I do this?


  [1]: http://stackoverflow.com/questions/3830603/php-domain-to-ip
