dev-sidecar/packages/mitmproxy/test/dnsTest.mjs

33 lines
799 B
JavaScript
Raw Normal View History

2020-11-08 16:54:55 +00:00
import dns from '../src/lib/dns/index.js'
const dnsProviders = dns.initDNS({
aliyun: {
type: 'https',
server: 'https://dns.alidns.com/dns-query',
cacheSize: 1000
},
usa: {
type: 'https',
server: 'https://cloudflare-dns.com/dns-query',
cacheSize: 1000
}
})
// let hostname = 'www.yonsz.com'
// dnsProviders.usa.lookup(hostname)
// const hostname = 'api.github.com'
// dnsProviders.usa.lookup(hostname)
const hostname1 = 'api.github.com'
dnsProviders.usa.lookup(hostname1)
const hostname2 = 'hk.docmirror.cn'
dnsProviders.usa.lookup(hostname2)
const hostname3 = 'github.docmirror.cn'
dnsProviders.usa.lookup(hostname3)
const hostname4 = 'gh.docmirror.top'
dnsProviders.usa.lookup(hostname4)
2020-11-19 01:15:08 +00:00
const hostname5 = 'gh2.docmirror.top'
dnsProviders.usa.lookup(hostname5)