From owner-freebsd-questions@FreeBSD.ORG Tue May 31 21:57:10 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 DE48416A41C for ; Tue, 31 May 2005 21:57:10 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from nic.ach.sch.gr (nic.sch.gr [194.63.238.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0032543D1D for ; Tue, 31 May 2005 21:57:09 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: (qmail 29482 invoked by uid 207); 31 May 2005 21:57:08 -0000 Received: from keramida@ceid.upatras.gr by nic by uid 201 with qmail-scanner-1.21 (sophie: 3.04/2.19/3.81. Clear:RC:1(81.186.70.84):. Processed in 0.540178 secs); 31 May 2005 21:57:08 -0000 Received: from dialup84.ach.sch.gr (HELO gothmog.gr) ([81.186.70.84]) (envelope-sender ) by nic.sch.gr (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 31 May 2005 21:57:07 -0000 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j4VLv3Rd001946; Wed, 1 Jun 2005 00:57:03 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j4VLv2Nj001945; Wed, 1 Jun 2005 00:57:02 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 1 Jun 2005 00:57:02 +0300 From: Giorgos Keramidas To: Vizion Message-ID: <20050531215702.GE1476@gothmog.gr> References: <200505311433.54138.vizion@vizion.occoxmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200505311433.54138.vizion@vizion.occoxmail.com> 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 21:57:11 -0000 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