Last updated on May 20th, 2016 at 03:50 pm
Get DNS Record using PHP
. We are using dns_get_record() and displaying it using foreach statement. This is a simple tutorial which will show you how to get the DNS information / lookup of a website using php.
<?php $result = dns_get_record("mistonline.in", DNS_ANY); echo "Result = "; print_r($result); ?> <hr /> <?php foreach($result as $y) // iterate array elements { if(is_array($y)) // check if $y is array { foreach($y as $k) // iterate array elements in $y (multidimensional) { echo $k."<br>"; // output the result } } }?>
I am getting Segmentation Faults if the domain contains TXT information. Know about this problem?
Can you please let me know the details of this error? In b/w which version of PHP you are using?