I need to get the IP address of a domain by the domain name.
- Site: hotmail.com / 65.55.72.151
- Site: domain.com / 65.254.244.180
Can it be done, and in that case, how can I do it?
You can use this code:
<?php
$ip = gethostbyname('www.site.com');
echo $ip;
?>
Or, you could operate it dynamically...
<?php
$url = $_GET['url'];
$ip = gethostbyname($url);
echo $ip;
?>
gethostbyname
:)