Prev | Current Page 475 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

Use
this when you want to be absolutely sure that all available records have been
retrieved.
DNS_ANY: Retrieves all records recognized by your particular operating system.
DNS_HINFO: Specifies the operating system and computer type of the host. Keep in
mind that this information is not required.
DNS_NS: Determines whether the name server is the authoritative answer for the
given domain, or whether this responsibility is ultimately delegated to another
server.
Just remember that the type names must always be prefaced with DNS_.
As an example, suppose you want to learn more about the example.com domain:
$result = dns_get_record("example.com");
print_r($result);
?>
406 CHAPTER 16 ?–  NE TWORKING
A sampling of the returned information follows:
Array (
[0] => Array (
[host] => example.com
[type] => NS
[target] => a.iana-servers.net
[class] => IN
[ttl] => 110275
)
[1] => Array (
[host] => example.com
[type] => A
[ip] => 192.0.34.166
[class] => IN
[ttl] => 88674
)
)
If you were only interested in the name server records, you could execute the
following:
$result = dns_get_record("example.com","DNS_CNAME");
print_r($result);
?>
This returns the following:
Array ( [0] => Array ( [host] => example.com [type] => NS
[target] => a.iana-servers.net [class] => IN [ttl] => 21564 )
[1] => Array ( [host] => example.com [type] => NS
[target] => b.


Pages:
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487