From 428aa503684e0f3d79730a1c7336db734846ffb6 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 22 May 2007 20:03:33 +0000 Subject: 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 --- src/configreader.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/configreader.cpp') 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: 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; } -- cgit v1.2.3