From owner-freebsd-isp Mon Dec 18 5:27:44 2000 From owner-freebsd-isp@FreeBSD.ORG Mon Dec 18 05:27:41 2000 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mgw1.MEIway.com (mgw1.meiway.com [212.73.210.75]) by hub.freebsd.org (Postfix) with ESMTP id 32B0237B400 for ; Mon, 18 Dec 2000 05:27:41 -0800 (PST) Received: from sv.Go2France.com (sv.meiway.com [212.73.210.79]) by mgw1.MEIway.com (Postfix Relay Hub) with ESMTP id 94FF56A90C for ; Mon, 18 Dec 2000 14:27:34 +0100 (CET) Message-Id: <5.0.2.1.0.20001218140245.03ada930@mail.Go2France.com> X-Sender: lconrad%Go2France.com@mail.Go2France.com X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Mon, 18 Dec 2000 14:26:30 +0100 To: freebsd-isp@freebsd.org From: Len Conrad Subject: Re: Off topic - shell skills In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >I have about 600 DNS zones on my DNS server, now because we are changing IP >addresses on our mail server most of those zones' MX/A records will need >updating. >How do I write a shell script that will change: Dave, I suppose many of your 600 domains share common RR's, and maybe even many have all RR's in common. Use the very handy BIND8 $INCLUDE directive to pkg all your common resource records in one include file: ;file: db.common @ NS ns1.ispplace.com. @ NS ns2.ispplace.com. ; @ MX 10 mailhost1.ispplace.com. @ MX 20 mailhost2.ispplace.com. ; Since you probably have many virtual www and ftp and smtp servers behind common ip's, you could have only a handful of zone files to cover all 600 domains. For groupA: ;file: db.groupA (maybe 500 domains?) @ SOA ns1.ispplace.com. hostmaster.ispplace.com. ( xxx xxx xxx xxx xxx ) ; $INLCUDE db.common ; ;web stuff @ A ip.ad.re.ss www A ip.ad.re.ss ftp A ip.ad.re.ss ; ;mail stuff smtp A ip.ad.re.ss pop A ip.ad.re.ss webmail A ip.ad.re.ss Then in your named.conf, all 500 zone statements refer to the same zone file: zone "somedomain.za" file "db.groupA"; zone "otherdomain.za" file "db.groupA"; zone "mydomain.za" file "db.groupB"; etc The above approach works for 600 or 6,000 or whatever number of domains. I recommend against CNAME's as way to dissociate hostnames from ip addresses, esp when the above techniques are available and the frequency of ip renumbering is low. It seems that most people screw up CNAME's sooner or later, plus CNAME's double the DNS traffic. Len http://BIND8NT.MEIway.com : Binary for ISC BIND 8.2.3 T9B for NT4 & W2K http://IMGate.MEIway.com : Build free, hi-perf, anti-spam mail gateways To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message