Attached is a small patch which detects 0.0.0.0 and replaces it by
127.0.0.1.
-- Henrik Nordstrom Squid hacker Kurt J. Lidl wrote: > At the very least, Squid should punt > out a warning in the log file complaining that it saw 0.0.0.0 as a > nameserver and is going to (erroronously) refuse all the packets from > the local nameserver, requiring the user to "fix" their non-broken > /etc/resolv.conf file.
Index: dns_internal.c
===================================================================
RCS file: /server/cvs-server/squid/squid/src/dns_internal.c,v
retrieving revision 1.36
diff -u -w -r1.36 dns_internal.c
--- dns_internal.c 2001/01/12 00:37:17 1.36
+++ dns_internal.c 2001/02/14 20:55:07
@@ -98,6 +98,11 @@
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;
Received on Wed Feb 14 2001 - 14:06:35 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:31 MST