Override manual DNS servers when using DoH/DoT (#283)
This commit is contained in:
parent
aec7f8eefe
commit
67fc2a3cc0
|
@ -94,8 +94,23 @@ extension WireGuard.ConfigurationBuilder {
|
||||||
break
|
break
|
||||||
|
|
||||||
case .manual:
|
case .manual:
|
||||||
|
let isDNSEnabled = settings.configurationType != .disabled
|
||||||
|
|
||||||
switch settings.configurationType {
|
switch settings.configurationType {
|
||||||
case .plain:
|
case .plain:
|
||||||
|
break
|
||||||
|
|
||||||
|
case .https:
|
||||||
|
dnsHTTPSURL = settings.dnsHTTPSURL
|
||||||
|
|
||||||
|
case .tls:
|
||||||
|
dnsTLSServerName = settings.dnsTLSServerName
|
||||||
|
|
||||||
|
case .disabled:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if isDNSEnabled {
|
||||||
dnsServers = settings.dnsServers ?? []
|
dnsServers = settings.dnsServers ?? []
|
||||||
var allDomains: [String] = []
|
var allDomains: [String] = []
|
||||||
if let domain = settings.dnsDomain {
|
if let domain = settings.dnsDomain {
|
||||||
|
@ -105,14 +120,7 @@ extension WireGuard.ConfigurationBuilder {
|
||||||
allDomains.append(contentsOf: searchDomains)
|
allDomains.append(contentsOf: searchDomains)
|
||||||
}
|
}
|
||||||
dnsSearchDomains = allDomains.filter { !$0.isEmpty }
|
dnsSearchDomains = allDomains.filter { !$0.isEmpty }
|
||||||
|
} else {
|
||||||
case .https:
|
|
||||||
dnsHTTPSURL = settings.dnsHTTPSURL
|
|
||||||
|
|
||||||
case .tls:
|
|
||||||
dnsTLSServerName = settings.dnsTLSServerName
|
|
||||||
|
|
||||||
case .disabled:
|
|
||||||
dnsServers = []
|
dnsServers = []
|
||||||
dnsSearchDomains = []
|
dnsSearchDomains = []
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue