错误修复和hub.docker.com的IP预设

pull/312/head
璀璨梦星 2024-05-12 12:24:58 +08:00
parent 9e58ed3ed0
commit 37b229c301
1 changed files with 7 additions and 2 deletions

View File

@ -19,11 +19,16 @@ module.exports = class DNSOverHTTPS extends BaseDNS {
// 20.27.177.113日本(三网平均延时88MS(三网优秀)) 20.205.243.166新加坡(三网平均延时96MS(电信联通106.5平均延时移动平均77MS)) 20.200.245.247韩国(三网平均108ms(移动平均120ms))
}
// 直接判断域名是否为example.com
if (hostname === 'github.com') {
log.info('域名github.com使用内置IP集')
if (hostname === 'api.github.com') {
log.info('域名api.github.com使用内置IP集')
// 返回预设的IP地址集
return ['20.27.177.116', '20.205.243.168', '20.200.245.245']
}
if (hostname === 'hub.docker.com') {
log.info('域名hub.docker.com使用内置IP集')
// 返回预设的IP地址集
return ['54.156.140.159', '52.44.227.212', '44.221.37.199']
}
try {
const result = await dohQueryAsync({ url: this.dnsServer }, [{ type: 'A', name: hostname }])
if (result.answers.length === 0) {