Net_DNS: Examples: MX Lookup

How to look up an MX record:

require_once("Net/DNS.php");
$res = new Net_DNS_Resolver();
$res->debug = 1;
$answer = $res->search("example.com", "MX");
echo "<BR><HR><BR>";
print_r($answer);

This example will query the name server and output the following: