From 2ed8a717db2406de72cfd4991f33cf3c02356c03 Mon Sep 17 00:00:00 2001 From: net909 Date: Sat, 1 Feb 2025 10:46:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnamesilo=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/DnsHelper.php | 1 + app/utils/CertDnsUtils.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/DnsHelper.php b/app/lib/DnsHelper.php index 831b1c7..073f25d 100644 --- a/app/lib/DnsHelper.php +++ b/app/lib/DnsHelper.php @@ -126,6 +126,7 @@ class DnsHelper 'huoshan' => ['DEF' => 'default', 'CT' => 'telecom', 'CU' => 'unicom', 'CM' => 'mobile', 'AB' => 'oversea'], 'baidu' => ['DEF' => 'default', 'CT' => 'ct', 'CU' => 'cnc', 'CM' => 'cmnet', 'AB' => ''], 'cloudflare' => ['DEF' => '0'], + 'namesilo' => ['DEF' => '0'], ]; public static function getList() diff --git a/app/utils/CertDnsUtils.php b/app/utils/CertDnsUtils.php index dd7621a..f1f951b 100644 --- a/app/utils/CertDnsUtils.php +++ b/app/utils/CertDnsUtils.php @@ -70,7 +70,8 @@ class CertDnsUtils } } - $res = $dns->addDomainRecord($row['name'], $row['type'], $row['value'], DnsHelper::$line_name[$drow['type']]['DEF'], 600); + $ttl = $drow['type'] == 'namesilo' ? 3600 : 600; + $res = $dns->addDomainRecord($row['name'], $row['type'], $row['value'], DnsHelper::$line_name[$drow['type']]['DEF'], $ttl); if (!$res && $row['type'] != 'CAA') throw new Exception('添加'.$domain.'解析记录失败,' . $dns->getError()); $log('Add DNS Record: '.$domain.' '.$row['type'].' '.$row['value']); }