This article mainly introduces the checkdnsrr function of the window platform implemented by php. PHP’s own checkdnsrr function is only valid on the linux platform. This article will A checkdnsrr function that can be used under window has been simulated. Friends who need it can refer to it
PHP’s built-in checkdnsrr function is only valid on the Linux platform. If you are used to using it and it cannot be used on the window platform, it will cause trouble for compatibility.
Therefore, I wrote a checkdnsrr simulation function to be used in the window platform environment.
?
10 11
12
13
|
if (!function_exists('checkdnsrr ')) { function checkdnsrr($host, $type) { if(!empty($host) && !empty($type)) { @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output); foreach ($output as $k => $line) { if(eregi('^' . $host, $line)) { return true; } } } return false; } } |