Returns a response from the DNS server after sending DNS query to designated DSN server IP address
string dns_lookup(string $name, int $type)
On success IP address, otherwise input host name
<?php
include "/lib/sn_dns.php";
dns_setup(0); // UDP 0
$host_name = "www.phpoc.com";
$host_addr = dns_lookup($host_name, RR_A); // sending query for www.phpoc.com
if($host_addr == $host_name)
echo "$host_name: Not Found\r\n"; // on fail
else
echo "$host_name: $host_addr\r\n"; // on sucess, output host's IP address
?>