windows support has been enhanced to function dns_get_record()
dns_get_record()
dns_get_record function used to Fetch DNS Resource Records associated with a hostname.
Syntax:
array dns_get_record ( string $hostname [, int $type = DNS_ANY [, array &$authns [, array &$addtl ]]] )
$hostname:
hostname should be a valid DNS hostname such as "www.example.com". Reverse lookups can be generated using in-addr.arpa notation, but gethostbyaddr() is more suitable for the majority of reverse lookups.
$type
By default, dns_get_record() will search for any resource records associated with hostname. To limit the query, specify the optional typeparameter. May be any one of the following: DNS_A, DNS_CNAME, DNS_HINFO, DNS_MX, DNS_NS, DNS_PTR, DNS_SOA, DNS_TXT, DNS_AAAA, DNS_SRV,DNS_NAPTR, DNS_A6, DNS_ALL or DNS_ANY.
$authns
Passed by reference and, if given, will be populated with Resource Records for the Authoritative Name Servers.
$addtl
Passed by reference and, if given, will be populated with any Additional Records.
example to fetch record from DNS
<?php/* Request "ANY" record for php.net,
and create $authns and $addtl arrays
containing list of name servers and
any additional records which go with
them */$result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
echo "Result = ";print_r($result);
echo "Auth NS = ";print_r($authns);
echo "Additional = ";print_r($addtl);?>
dns_get_record()
dns_get_record function used to Fetch DNS Resource Records associated with a hostname.
Syntax:
array dns_get_record ( string $hostname [, int $type = DNS_ANY [, array &$authns [, array &$addtl ]]] )
$hostname:
hostname should be a valid DNS hostname such as "www.example.com". Reverse lookups can be generated using in-addr.arpa notation, but gethostbyaddr() is more suitable for the majority of reverse lookups.
$type
By default, dns_get_record() will search for any resource records associated with hostname. To limit the query, specify the optional typeparameter. May be any one of the following: DNS_A, DNS_CNAME, DNS_HINFO, DNS_MX, DNS_NS, DNS_PTR, DNS_SOA, DNS_TXT, DNS_AAAA, DNS_SRV,DNS_NAPTR, DNS_A6, DNS_ALL or DNS_ANY.
$authns
Passed by reference and, if given, will be populated with Resource Records for the Authoritative Name Servers.
$addtl
Passed by reference and, if given, will be populated with any Additional Records.
example to fetch record from DNS
<?php/* Request "ANY" record for php.net,
and create $authns and $addtl arrays
containing list of name servers and
any additional records which go with
them */$result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
echo "Result = ";print_r($result);
echo "Auth NS = ";print_r($authns);
echo "Additional = ";print_r($addtl);?>
No comments:
Post a Comment