增加CNAME+A和CNAME+AAAA记录,增加域名不存在应答

This commit is contained in:
2022-12-18 18:01:07 +08:00
parent af2df369e6
commit 03b27f8cb1
5 changed files with 236 additions and 8 deletions
+19 -2
View File
@@ -1,3 +1,20 @@
<?php
print_r(dns_get_record('cname.n2n.icu',DNS_A));
?>
#print_r(dns_get_record('icu',DNS_SOA));
$url='al.c919.n3n.com.cn';
while(true){
preg_match("#\.(.*)#i",$url,$match);//获取根域名
$domin = $match[1];
print_r($domin);
$soa=dns_get_record($domin,DNS_SOA);
if(array_key_exists('0',$soa)){
if(array_key_exists('mname',$soa[0])){
print_r($soa[0]);
break;
}else{
$url=$domin;
}
}else{
$url=$domin;
}
}
?>