PHP get DNS records without caching
Does anyone know how one can get DNS records for a domain.
I have used php and this function: dns_get_record
to do it so far, but realized that this command is getting cached DNS records and therefore not the latest information.
Does anyone know about this in PHP or another language?
+2
source to share
3 answers
This may not be a "polite fix", but with php you can also invoke system commands and shell scripts:
ie:
$ host -t ns stackoverflow.com stackoverflow.com name server cf-dns02.stackoverflow.com. stackoverflow.com name server cf-dns01.stackoverflow.com.
So:
<?php
echo '<pre>';
$last_line = system('ls', $retval);
echo '
</pre>
last line: ' . $last_line . '
return value: ' . $retval;
?>
0
source to share