From: serassio <> Date: Tue, 25 Jul 2006 01:21:26 +0000 (+0000) Subject: Bug #991: squid should fallback from resolv.conf to localhost X-Git-Tag: SQUID_3_0_PRE5~213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29fe9bd5dbed46cea54065b252e4c2b6b23cd663;p=thirdparty%2Fsquid.git Bug #991: squid should fallback from resolv.conf to localhost (according to linux resolv.conf manpage) Forward port of an old 2.5 patch. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 43eecd322d..17e2d83972 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -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);