From 8fe014236a59dad7f7a57cb09842274279274d2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 17 Oct 2000 19:18:50 +0200
Subject: [PATCH] Now defaults to using 127.0.0.1 as nameserver if
 /etc/resolv.conf is missing.

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.52
---
 lib/modules/Protocols.pmod/DNS.pmod | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/modules/Protocols.pmod/DNS.pmod b/lib/modules/Protocols.pmod/DNS.pmod
index 1aebb25b49..515dd5f52d 100644
--- a/lib/modules/Protocols.pmod/DNS.pmod
+++ b/lib/modules/Protocols.pmod/DNS.pmod
@@ -4,7 +4,7 @@
 //! module Protocols
 //! submodule DNS
 
-//! $Id: DNS.pmod,v 1.51 2000/09/28 03:38:49 hubbe Exp $
+//! $Id: DNS.pmod,v 1.52 2000/10/17 17:18:50 grubba Exp $
 
 #pike __REAL_VERSION__
 
@@ -499,7 +499,8 @@ class client
       domains += (get_tcpip_param("SearchList", "") / " ") - ({ "" });
 #else
       string resolv_conf;
-      foreach(({"/etc/resolv.conf", "/amitcp/db/resolv.conf"}), string resolv_loc)
+      foreach(({"/etc/resolv.conf", "/amitcp/db/resolv.conf"}),
+	      string resolv_loc)
         if ((resolv_conf = Stdio.read_file(resolv_loc)))
 	  break;
 
@@ -507,9 +508,15 @@ class client
 	/* FIXME: Is this a good idea?
 	 * Why not just try the fallback?
 	 * /grubba 1999-04-14
+	 *
+	 * Now uses 127.0.0.1 as fallback.
+	 * /grubba 2000-10-17
 	 */
+	resolv_conf = "nameserver 127.0.0.1";
+#if 0
 	throw(({ "Protocols.DNS.client(): No /etc/resolv.conf!\n",
 		 backtrace() }));
+#endif /* 0 */
       }
 
       foreach(resolv_conf/"\n", string line)
-- 
GitLab