当我在php脚本中使用dns_get_record获取域的DNS记录列表时,会返回一个记录列表.
但是,如果我再次运行脚本,它不会返回所有相同的结果(即它只返回名称服务器)然后如果我再次运行它,它的工作原理等.
这是我正在使用的代码:
$result = dns_get_record("php.net");
print_r($result);
是否有更好的使用功能或更可靠的查询DNS记录的方式?
不工作:
数组([0] =>数组([主机] => php.net [类型] => NS [目标] => remote2.easydns.com [class] => IN [ttl] => 38772)[1] =>数组([host] => php.net [type] => NS [target] => ns1.easydns.com [class] => IN [ttl] => 38772)[2] =>数组([主机] => php.net [类型] => NS [目标] => ns2.easydns.com [类] => IN [ttl] => 38772)[3] =>数组([主机] => php.net [类型] => NS [目标] => remote1.easydns.com [class] => IN [ttl] => 38772))
工作方式:
Array([0] => Array([host] => php.net [type] => MX [pri] => 5 [target] => osu1.php.net [class] => IN [ttl] => 72984)[1] =>数组([主机] => php.net [类型] => MX [pri] => 15 [目标] => smtp.osuosl. org [class] => IN [ttl] => 72984)[2] =>数组([host] => php.net [type] => NS [target] => remote2.easydns. com [class] => IN [ttl] => 30054)[3] =>数组([host] => php.net [type] => NS [target] => ns1.easydns. com [class] => IN [ttl] => 30054)[4] =>数组([host] => php.net [type] => NS [target] => ns2.easydns. com [class] => IN [ttl] => 30054)[5] =>数组([host] => php.net [type] => NS [target] => remote1.easydns. com [class] => IN [ttl] => 30054))