feat: rubyfish dns

pull/67/head
xiaojunnuo 2021-03-24 14:18:27 +08:00
parent 219323a0d6
commit 006420e06e
4 changed files with 42 additions and 10 deletions

View File

@ -166,6 +166,11 @@ module.exports = {
type: 'https', type: 'https',
server: 'https://9.9.9.9/dns-query', server: 'https://9.9.9.9/dns-query',
cacheSize: 1000 cacheSize: 1000
},
rubyfish: {
type: 'https',
server: 'https://rubyfish.cn/dns-query',
cacheSize: 1000
} }
// google: { // google: {
// type: 'https', // type: 'https',
@ -194,7 +199,7 @@ module.exports = {
}, },
speedTest: { speedTest: {
hostnameList: ['github.com'], hostnameList: ['github.com'],
dnsProviders: ['usa', 'quad9'] dnsProviders: ['usa', 'quad9', 'rubyfish']
} }
} }
}, },

View File

@ -81,7 +81,7 @@ class SpeedTester {
async test () { async test () {
this.backupList = await this.getIpListFromDns(this.dnsMap) this.backupList = await this.getIpListFromDns(this.dnsMap)
log.info('[speed]', this.hostname, ' ips:', this.backupList) log.info('[speed]', this.hostname, ' ips:', this.backupList)
this.testBackups() await this.testBackups()
} }
async testBackups () { async testBackups () {

View File

@ -3,22 +3,27 @@ const SpeedTest = require('../src/lib/speed/index.js')
const dns = require('../src/lib/dns/index.js') const dns = require('../src/lib/dns/index.js')
const dnsMap = dns.initDNS({ const dnsMap = dns.initDNS({
ipaddress: { // ipaddress: {
type: 'ipaddress', // type: 'ipaddress',
server: 'ipaddress', // server: 'ipaddress',
cacheSize: 1000 // cacheSize: 1000
}, // },
usa: { usa: {
type: 'https', type: 'https',
server: 'https://1.1.1.1/dns-query', server: 'https://1.1.1.1/dns-query',
cacheSize: 1000 cacheSize: 1000
} }
// google: { // py233: { //污染
// type: 'https',
// server: ' https://i.233py.com/dns-query',
// cacheSize: 1000
// }
// google: { //不可用
// type: 'https', // type: 'https',
// server: 'https://8.8.8.8/dns-query', // server: 'https://8.8.8.8/dns-query',
// cacheSize: 1000 // cacheSize: 1000
// }, // },
// dnsSB: { // dnsSB: { //不可用
// type: 'https', // type: 'https',
// server: 'https://doh.dns.sb/dns-query', // server: 'https://doh.dns.sb/dns-query',
// cacheSize: 1000 // cacheSize: 1000

View File

@ -20,7 +20,29 @@ const dnsProviders = dns.initDNS({
type: 'https', type: 'https',
server: 'https://9.9.9.9/dns-query', server: 'https://9.9.9.9/dns-query',
cacheSize: 1000 cacheSize: 1000
},
rubyfish: {
type: 'https',
server: 'https://rubyfish.cn/dns-query',
cacheSize: 1000
},
py233: {
type: 'https',
server: ' https://i.233py.com/dns-query',
cacheSize: 1000
} }
// sb: {
// type: 'https',
// server: 'https://doh.dns.sb/dns-query',
// cacheSize: 1000
// },
// adguard: {
// type: 'https',
// server: ' https://dns.adguard.com/dns-query',
// cacheSize: 1000
// }
}) })
// const test = '111<tr><th>IP Address</th><td><ul class="comma-separated"><li>140.82.113.4</li></ul></td></tr>2222' // const test = '111<tr><th>IP Address</th><td><ul class="comma-separated"><li>140.82.113.4</li></ul></td></tr>2222'
@ -34,7 +56,7 @@ const hostname0 = 'github.com'
// console.log('first') // console.log('first')
// dnsProviders.usa.lookup(hostname0) // dnsProviders.usa.lookup(hostname0)
console.log('test') console.log('test')
dnsProviders.quad9.lookup(hostname0) dnsProviders.py233.lookup(hostname0)
// dnsProviders.usa.lookup(hostname0) // dnsProviders.usa.lookup(hostname0)
// dnsProviders.ipaddress.lookup(hostname0) // dnsProviders.ipaddress.lookup(hostname0)
// dnsProviders.ipaddress.lookup(hostname0) // dnsProviders.ipaddress.lookup(hostname0)