With just a single statement it is possible to find out the IP address of a domain or URL.
Simply use the
gethostbyname() function in PHP to get the IP address.
See the example below to find out how to use this function.
You find the output of the code below the code.
<?php $domain = "Computer-Masters.net"; $ip = gethostbyname($domain); echo "Domain: ".$domain; echo "<br>"; echo "IP: ".$ip; ?>
The output of the code is the following:Domain: Computer-Masters.net
You can also simply use this form to get the IP of a hostname:
These articles might also be interesting for you: