summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-22 20:03:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-22 20:03:33 +0000
commit428aa503684e0f3d79730a1c7336db734846ffb6 (patch)
treea05d6eefe8069c55500680a8325ac5961282adb8 /src
parent75f0cba571dca97f181835d3645c3d42dd5daf2d (diff)
Code to find nameservers in the windows registry - largely untested
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7113 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-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;
}