Skip to content

Commit

Permalink
feat: 优化 dns 解析
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Nov 20, 2019
1 parent 29d0b7c commit 345790e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utils/dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const DomainCache = new LRU<string, ReadonlyArray<string>>({
max: 1000,
});

resolver.setServers(['223.5.5.5', '114.114.114.114', '8.8.8.8', '1.1.1.1']);
// istanbul ignore next
if (process.env.NOW_REGION) {
resolver.setServers(['1.1.1.1', '8.8.8.8']);
} else {
resolver.setServers(['223.5.5.5', '114.114.114.114']);
}

export const resolveDomain = async (domain: string): Promise<ReadonlyArray<string>> => {
if (DomainCache.has(domain)) {
Expand Down

0 comments on commit 345790e

Please sign in to comment.