Prev | Current Page 474 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

Its prototype follows:
array dns_get_record(string hostname [, int type [, array &authns, array &addtl]])
Although by default dns_get_record() returns all records it can find specific to the
supplied domain (hostname), you can streamline the retrieval process by specifying a
type, the name of which must be prefaced with DNS. This function supports all the types
introduced along with checkdnsrr(), in addition to others that will be introduced in a
moment. Finally, if you??™re looking for a full-blown description of this hostname??™s DNS
CHAPTER 16 ?–  NETWORKING 405
description, you can pass the authns and addtl parameters in by reference, which
specify that information pertinent to the authoritative name servers and additional
records also should be returned.
Assuming that the supplied hostname is valid and exists, a call to dns_get_record()
returns at least four attributes:
host: Specifies the name of the DNS namespace to which all other attributes
correspond.
class: Returns records of class Internet only, so this attribute always reads IN.
type: Determines the record type. Depending upon the returned type, other
attributes might also be made available.
ttl: Calculates the record??™s original time-to-live minus the amount of time that
has passed since the authoritative name server was queried.
In addition to the types introduced in the section on checkdnsrr(), the following
domain record types are made available to dns_get_record():
DNS_ALL: Retrieves all available records, even those that might not be recognized
when using the recognition capabilities of your particular operating system.


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