summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 36cafd111..4702ce816 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -221,6 +221,9 @@ bool ValidateDnsServer(ServerConfig* conf, const char* tag, const char* value, V
{
if (!*(data.GetString()))
{
+#ifdef WINDOWS
+ data.Set(FindNameServerWin().c_str());
+#else
// attempt to look up their nameserver from /etc/resolv.conf
conf->GetInstance()->Log(DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
ifstream resolv("/etc/resolv.conf");
@@ -251,6 +254,7 @@ bool ValidateDnsServer(ServerConfig* conf, const char* tag, const char* value, V
conf->GetInstance()->Log(DEFAULT,"/etc/resolv.conf can't be opened! Defaulting to nameserver '127.0.0.1'!");
data.Set("127.0.0.1");
}
+#endif
}
return true;
}