Saturday, 24 December 2011

windows support function dns_get_record() in php 5.3.8

 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_ADNS_CNAMEDNS_HINFODNS_MXDNS_NSDNS_PTRDNS_SOADNS_TXTDNS_AAAADNS_SRV,DNS_NAPTRDNS_A6DNS_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