Override local to dhcp for macOS Tun mode

This commit is contained in:
Nova 2025-10-19 01:09:23 +03:30
parent ad8bd3a570
commit 16d951eed1

View File

@ -423,8 +423,12 @@ namespace Configs {
QJsonObject BuildDnsObject(QString address, bool tunEnabled)
{
bool usingSystemdResolved = false;
bool isDarwin = false;
#ifdef Q_OS_LINUX
usingSystemdResolved = ReadFileText("/etc/resolv.conf").contains("systemd-resolved");
#endif
#ifdef Q_OS_MACOS
isDarwin = true;
#endif
if (address.startsWith("local"))
{
@ -434,6 +438,13 @@ namespace Configs {
{"type", "underlying"}
};
}
if (tunEnabled && isDarwin)
{
MW_show_log(R"(DNS has been overriden to dhcp, if it does not work, please change both "Routing settings->Direct DNS" and "basic settings->Core->Core options->underlying dns" to something other than local)");
return {
{"type", "dhcp"}
};
}
return {
{"type", "local"}
};