Don't setup secondary DNS for OpenVPN with AmneziaDNS
This commit is contained in:
parent
d434e33e47
commit
bb0099cb74
1 changed files with 12 additions and 0 deletions
|
|
@ -118,6 +118,12 @@ QString OpenVpnConfigurator::processConfigWithLocalSettings(const QPair<QString,
|
||||||
QRegularExpression regex("redirect-gateway.*");
|
QRegularExpression regex("redirect-gateway.*");
|
||||||
config.replace(regex, "");
|
config.replace(regex, "");
|
||||||
|
|
||||||
|
// We don't use secondary DNS if primary DNS is AmneziaDNS
|
||||||
|
if (dns.first.contains(protocols::dns::amneziaDnsIp)) {
|
||||||
|
QRegularExpression dnsRegex("dhcp-option DNS " + dns.second);
|
||||||
|
config.replace(dnsRegex, "");
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_settings->isSitesSplitTunnelingEnabled()) {
|
if (!m_settings->isSitesSplitTunnelingEnabled()) {
|
||||||
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
|
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
|
||||||
|
|
||||||
|
|
@ -169,6 +175,12 @@ QString OpenVpnConfigurator::processConfigWithExportSettings(const QPair<QString
|
||||||
QRegularExpression regex("redirect-gateway.*");
|
QRegularExpression regex("redirect-gateway.*");
|
||||||
config.replace(regex, "");
|
config.replace(regex, "");
|
||||||
|
|
||||||
|
// We don't use secondary DNS if primary DNS is AmneziaDNS
|
||||||
|
if (dns.first.contains(protocols::dns::amneziaDnsIp)) {
|
||||||
|
QRegularExpression dnsRegex("dhcp-option DNS " + dns.second);
|
||||||
|
config.replace(dnsRegex, "");
|
||||||
|
}
|
||||||
|
|
||||||
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
|
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
|
||||||
|
|
||||||
// Prevent ipv6 leak
|
// Prevent ipv6 leak
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue