feat(networksettings): cache dns off by default

This commit is contained in:
fallenbagel
2025-02-23 03:23:03 +08:00
committed by gauthier-th
parent 2a12cb84c6
commit 73fd763890
2 changed files with 7 additions and 4 deletions

View File

@@ -143,6 +143,7 @@ export interface NetworkSettings {
forceIpv4First: boolean;
trustProxy: boolean;
proxy: ProxySettings;
cacheDns: boolean;
}
interface PublicSettings {
@@ -542,6 +543,7 @@ class Settings {
bypassFilter: '',
bypassLocalAddresses: true,
},
cacheDns: false,
},
};
if (initialSettings) {

View File

@@ -313,7 +313,7 @@ class DnsCacheManager {
.then((result) => {
const preferredFamily = shouldForceIpv4
? 4
: getSettings().main.forceIpv4First
: getSettings().network.forceIpv4First
? 4
: 6;
@@ -351,7 +351,7 @@ class DnsCacheManager {
const preferredFamily = shouldForceIpv4
? 4
: getSettings().main.forceIpv4First
: getSettings().network.forceIpv4First
? 4
: 6;
@@ -699,7 +699,8 @@ class DnsCacheManager {
.filter((a) => a.family === 6)
.map((a) => a.address);
const preferIpv4 = this.testMode || getSettings().main.forceIpv4First;
const preferIpv4 =
this.testMode || getSettings().network.forceIpv4First;
let activeAddress: string;
let family: number;
@@ -751,7 +752,7 @@ class DnsCacheManager {
throw new Error('No addresses resolved');
}
const preferIpv4 = this.testMode || getSettings().main.forceIpv4First;
const preferIpv4 = this.testMode || getSettings().network.forceIpv4First;
let activeAddress: string;
let family: number;