]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #991: squid should fallback from resolv.conf to localhost
authorserassio <>
Tue, 25 Jul 2006 01:21:26 +0000 (01:21 +0000)
committerserassio <>
Tue, 25 Jul 2006 01:21:26 +0000 (01:21 +0000)
(according to linux resolv.conf manpage)

Forward port of an old 2.5 patch.

src/dns_internal.cc

index 43eecd322d03ec7a53c28581acde7285d5ebd2de..17e2d83972d797637d26c72ea1e3418cfb78221d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns_internal.cc,v 1.89 2006/05/29 00:15:02 robertc Exp $
+ * $Id: dns_internal.cc,v 1.90 2006/07/24 19:21:26 serassio Exp $
  *
  * DEBUG: section 78    DNS lookups; interacts with lib/rfc1035.c
  * AUTHOR: Duane Wessels
@@ -1232,14 +1232,19 @@ idnsInit(void)
 
 #endif
 
-    if (0 == nns)
-        fatal("Could not find any nameservers.\n"
+    if (0 == nns) {
+        debugs(78, 1, "Warning: Could not find any nameservers. Trying to use localhost");
 #ifdef _SQUID_WIN32_
-              "       Please check your TCP-IP settings or /etc/resolv.conf file\n"
+
+        debugs(78, 1, "Please check your TCP-IP settings or /etc/resolv.conf file");
 #else
-              "       Please check your /etc/resolv.conf file\n"
+
+        debugs(78, 1, "Please check your /etc/resolv.conf file");
 #endif
-              "       or use the 'dns_nameservers' option in squid.conf.");
+
+        debugs(78, 1, "or use the 'dns_nameservers' option in squid.conf.");
+        idnsAddNameserver("127.0.0.1");
+    }
 
     if (!init) {
         memDataInit(MEM_IDNS_QUERY, "idns_query", sizeof(idns_query), 0);