mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2026-05-09 18:11:26 +08:00
Fix: fix dns fake-ip patch
This commit is contained in:
@@ -20,4 +20,5 @@ var (
|
|||||||
// Nintendo Switch
|
// Nintendo Switch
|
||||||
"*.n.n.srv.nintendo.net",
|
"*.n.n.srv.nintendo.net",
|
||||||
}
|
}
|
||||||
|
defaultFakeIPRange = "28.0.0.0/8"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -62,19 +62,24 @@ func patchProfile(cfg *config.RawConfig, _ string) error {
|
|||||||
|
|
||||||
func patchDns(cfg *config.RawConfig, _ string) error {
|
func patchDns(cfg *config.RawConfig, _ string) error {
|
||||||
if !cfg.DNS.Enable {
|
if !cfg.DNS.Enable {
|
||||||
cfg.DNS.Enable = true
|
cfg.DNS = config.RawDNS{
|
||||||
cfg.DNS.IPv6 = false
|
Enable: true,
|
||||||
cfg.DNS.NameServer = defaultNameServers
|
UseHosts: true,
|
||||||
cfg.DNS.EnhancedMode = C.DNSFakeIP
|
DefaultNameserver: defaultNameServers,
|
||||||
cfg.DNS.FakeIPRange = "28.0.0.0/8"
|
NameServer: defaultNameServers,
|
||||||
cfg.DNS.DefaultNameserver = defaultNameServers
|
EnhancedMode: C.DNSFakeIP,
|
||||||
cfg.DNS.FakeIPFilter = defaultFakeIPFilter
|
FakeIPRange: defaultFakeIPRange,
|
||||||
|
FakeIPFilter: defaultFakeIPFilter,
|
||||||
|
FallbackFilter: config.RawFallbackFilter{
|
||||||
|
GeoIP: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
cfg.ClashForAndroid.AppendSystemDNS = true
|
cfg.ClashForAndroid.AppendSystemDNS = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.ClashForAndroid.AppendSystemDNS {
|
if cfg.ClashForAndroid.AppendSystemDNS {
|
||||||
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "dhcp://" + dns.SystemDNSPlaceholder)
|
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "dhcp://"+dns.SystemDNSPlaceholder)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user