PHP function CHECKDNSRR Usage (Windows platform usage), CHECKDNSRR detailed
The examples in this paper describe the PHP function CHECKDNSRR usage. Share to everyone for your reference, as follows:
This is said on the php.net:
(PHP 4, PHP 5)
Checkdnsrr-check DNS Records corresponding to a given Internet host name or IP address
CHECKDNSRR--a given host name (domain name) or IP address to check if it has a DNS record, in fact, it is to verify that it exists.
Note:this function is now available on Windows platforms.
Note: This function is not supported on Windows platforms
I tried it, and sure enough, the hint didn't have this function.
Here is a hack method, so that when we do development on windows, we can see the effect!
if (!function_exists (' CHECKDNSRR ')) { function checkdnsrr ($host, $type = ') { if (!empty ($host)) { $type = ( Empty ($type))? ' MX ': $type; EXEC (' nslookup-type= '. $type. ' '. Escapeshellcmd ($host), $result); $it = new Arrayiterator ($result); foreach (New Regexiterator ($it, ' ~^ '. $host. ' ~ ', Regexiterator::get_match) as $result) { if ($result) { return true; } } } return false; }}
Now let me introduce the parameters:
BOOL CHECKDNSRR (String $host [, String $type = "MX"])
The first parameter we will not say, is the domain name or IP
The second parameter is the parse type, respectively:
A (address) record is the IP address record that corresponds to the specified hostname (or domain name).
MX record is a specified mail exchange record (default)
The NS record is the record of the specified domain name server, specifying which DNS the domain name is to be parsed.
SOA records are typically used in a secondary DNS server to designate who is the primary server.
PTR records reverse parsing records from IP to domain name
CNAME record alias record
AAAA record is a record pointing to IPv6
A6 Record Ibid.
SRV records It is a type of resource record that is supported in the DNS server's database, and is typically applied to Microsoft's Active Directory settings.
TXT record text information
Any records any records, all data types
This function is often used by us to detect if an email is real!
More readers interested in PHP related content can view this site topic: "PHP Operations Office Document Tips summary (including word,excel,access,ppt)", "PHP date and Time usage summary", "PHP Object-oriented Programming tutorial", "PHP string (string) Usage summary, "Getting Started with Php+mysql database operation" and "PHP common database Operation Skills Summary"
I hope this article is helpful to you in PHP programming.
Articles you may be interested in:
- PHP implements the CHECKDNSRR function of window platform
- Simple analysis of PHP program to prevent DDOS,DNS, Cluster Server attack solution
- Simply talk about the strlen function in PHP
- PHP Powerful Time-conversion function strtotime
- PHP function Timeout processing method
- A detailed description of the PHP closure function
- Several common cryptographic functions of PHP
- PHP performs common functions for Linux commands summary
- Summary of several useful custom functions in PHP
- Using PHP scripts to encrypt strings using the MD5 function under Linux
- How to support PHP's Iconv () function on Linux systems
- A description of common functions used by PHP to execute Linux system commands
http://www.bkjia.com/PHPjc/1113743.html www.bkjia.com true http://www.bkjia.com/PHPjc/1113743.html techarticle PHP functions CHECKDNSRR Usage (Windows platform usage), CHECKDNSRR detailed examples of this article describes the PHP function CHECKDNSRR usage. Share to everyone for your reference, as follows: On the Php.net ...