From owner-freebsd-questions@FreeBSD.ORG Tue May 31 22:43:43 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95E4216A41C for ; Tue, 31 May 2005 22:43:43 +0000 (GMT) (envelope-from wmoran@potentialtech.com) Received: from internet.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE8343D49 for ; Tue, 31 May 2005 22:43:43 +0000 (GMT) (envelope-from wmoran@potentialtech.com) Received: from localhost (24-53-250-148.pittpa.adelphia.net [24.53.250.148]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by internet.potentialtech.com (Postfix) with ESMTP id 9AC2469A3E; Tue, 31 May 2005 18:43:42 -0400 (EDT) Date: Tue, 31 May 2005 18:43:41 -0400 From: Bill Moran To: Vizion Message-Id: <20050531184341.5fae492b.wmoran@potentialtech.com> In-Reply-To: <200505311502.42243.vizion@vizion.occoxmail.com> References: <200505311433.54138.vizion@vizion.occoxmail.com> <20050531215702.GE1476@gothmog.gr> <200505311502.42243.vizion@vizion.occoxmail.com> Organization: Potential Technologies X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-portbld-freebsd5.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: nameserver changing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2005 22:43:43 -0000 Vizion wrote: > On Tuesday 31 May 2005 14:57, the author Giorgos Keramidas contributed to the > dialogue on- > Re: nameserver changing: > > >On 2005-05-31 14:33, Vizion wrote: > >> Hi > >> > >> I want to be able to automatically remove/add one or more dns servers from > >> the list of dns's used as resolvers by particular machine(s) on a network > >> which I control from data stored in a file in each computer. > >> e.g file might contain lines such as: > >> xxx.xxx.xxx.xxx remove dns xxx.xxx.xxx > >> xxx.xxx.xxx.xxx add dns xxx.xxx.xxx > >> None of the machines are running their own dns servers. > >> The changes will be initiated by cron. > >> > >> Don't ask me why I need to do it -- the answer is far too complicated :-) > >> > >> Suggestions please > > > >You could use the "template" file as a source and generate a shell > >script that will be scp'ed and executed on each host. If you have enoug > >time, you could write a Perl script that will read this format: > > > > 10.0.0.0/8 remove * > > 10.0.0.0/8 add 10.0.0.2 > > > >and then create one Perl script for every host. The script could be > >scp'ed (if you have SSH keys set up correctly) and run remotely, with > >something like: > > > > # cat scripts/10.0.0.1.sh | ssh -l root 10.0.0.1 > > thanks - that sounds reasonable -- is freebsd configured to refer to > etc/hosts to look up the dns server ips on every occasion or do I have to > reload? > David FreeBSD uses /etc/resolv.conf to find DNS servers. In my experience, any changes to that file take effect immediately, with no reboot or other magic required. -- Bill Moran Potential Technologies http://www.potentialtech.com