# Bootstrap DNS 服务器,用于解析cn组上游的 DoH 解析器的 IP 地址 server 223.6.6.6 -group alidns -exclude-default-group server 223.5.5.5 -group alidns -exclude-default-group server 119.29.29.29 -group dnspod -exclude-default-group server 119.28.28.28 -group dnspod -exclude-default-group
# Bootstrap DNS 服务器,用于解析指定为上游的 DoH 解析器的 IP 地址 server 8.8.8.8 -group google -exclude-default-group server 8.8.4.4 -group google -exclude-default-group server 1.1.1.1 -group cloudflare -exclude-default-group server 1.0.0.1 -group cloudflare -exclude-default-group server 9.9.9.9 -group quad9 -exclude-default-group server 208.67.222.222 -group opendns -exclude-default-group
echo $(date) # 检查文件是否存在,如果存在则备份文件 if [ -f /etc/smartdns/domain-set/cn.conf ]; then mv /etc/smartdns/domain-set/cn.conf /etc/smartdns/domain-set/cn.conf.bak fi
echo"获取最新配置文件" if curl -sSf "https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt" >> /etc/smartdns/domain-set/cn.conf && curl -sSf "https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/apple-cn.txt" >> /etc/smartdns/domain-set/cn.conf && curl -sSf "https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/google-cn.txt" >> /etc/smartdns/domain-set/cn.conf && sed "s/^full://g;s/^regexp:.*$//g;s/^/nameserver \//g;s/$/\/cn/g" -i /etc/smartdns/domain-set/cn.conf then echo"删除旧的备份文件" if [ -f /etc/smartdns/domain-set/cn.conf.bak ]; then rm /etc/smartdns/domain-set/cn.conf.bak fi
echo"重载配置文件" if service smartdns reload; then echo"Smartdns:规则更新成功" else echo"Smartdns:重载失败" exit 1 fi
else if [ -f /etc/smartdns/domain-set/cn.conf.bak ]; then mv /etc/smartdns/domain-set/cn.conf.bak /etc/smartdns/domain-set/cn.conf fi echo"下载配置文件失败,已恢复旧配置文件" fi