From: hno <> Date: Thu, 15 Feb 2001 03:58:10 +0000 (+0000) Subject: Detect 0.0.0.0 DNS server specifications, warn the user and use X-Git-Tag: SQUID_3_0_PRE1~1600 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c5a349d6a38fc00c34fb1d30ee3b1b79355af21;p=thirdparty%2Fsquid.git Detect 0.0.0.0 DNS server specifications, warn the user and use 127.0.0.1 instead. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index ca4124e2dd..83d88aeea3 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.36 2001/01/12 00:37:17 wessels Exp $ + * $Id: dns_internal.cc,v 1.37 2001/02/14 20:58:10 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -98,6 +98,11 @@ idnsAddNameserver(const char *buf) debug(78, 0) ("WARNING: rejecting '%s' as a name server, because it is not a numeric IP address\n", buf); return; } + if (A.s_addr == 0) { + debug(78, 0) ("WARNING: Squid does not accept 0.0.0.0 in DNS server specifications.\n"); + debug(78, 0) ("Will be using 127.0.0.1 instead, assuming you meant that DNS is running on the same machine\n"); + safe_inet_addr("127.0.0.1", &A); + } if (nns == nns_alloc) { int oldalloc = nns_alloc; ns *oldptr = nameservers;