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
|
||||
|
||||
case .manual:
|
||||
let isDNSEnabled = settings.configurationType != .disabled
|
||||
|
||||
switch settings.configurationType {
|
||||
case .plain:
|
||||
break
|
||||
|
||||
case .https:
|
||||
dnsHTTPSURL = settings.dnsHTTPSURL
|
||||
|
||||
case .tls:
|
||||
dnsTLSServerName = settings.dnsTLSServerName
|
||||
|
||||
case .disabled:
|
||||
break
|
||||
}
|
||||
|
||||
if isDNSEnabled {
|
||||
dnsServers = settings.dnsServers ?? []
|
||||
var allDomains: [String] = []
|
||||
if let domain = settings.dnsDomain {
|
||||
|
@ -105,14 +120,7 @@ extension WireGuard.ConfigurationBuilder {
|
|||
allDomains.append(contentsOf: searchDomains)
|
||||
}
|
||||
dnsSearchDomains = allDomains.filter { !$0.isEmpty }
|
||||
|
||||
case .https:
|
||||
dnsHTTPSURL = settings.dnsHTTPSURL
|
||||
|
||||
case .tls:
|
||||
dnsTLSServerName = settings.dnsTLSServerName
|
||||
|
||||
case .disabled:
|
||||
} else {
|
||||
dnsServers = []
|
||||
dnsSearchDomains = []
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue