Zone transfer changing the zone name
WebReactor Networks
bind at webreactor.net
Tue Feb 19 18:17:51 UTC 2002
You could also use named-xfer instead of dig. It will transfer the zone info without duplication the SOA. You will then need to remove the $ORIGIN, test and write it to your new zone file. Something like what Michael Kj%F6rling proposes:
$ named-xfer -z tb.opi1.it. -f /tmp/tb.opi1.it.$$ bohrdns1.tb.opi1.it.
$ grep -v '$ORIGIN' /tmp/db.zone.with_origin.$$ > /tmp/db.zone.no_origin.$$
$ named-checkzone tb.opi1.it /tmp/db.zone.no_origin.$$ && ( mv /tmp/db.zone.no_origin.$$ /[bind_root]/tb.opi1.it; ndc reload tb.opi1.it.)
$ rm /tmp/db.zone.*_origin.$$
I can't see any way around scripting a little bit.
-------- Original Message --------
Subject: Re: Zone transfer changing the zone name
Date: Tue, 19 Feb 2002 19:04:34 +0100 (CET)
From: Michael Kjorling <michael at kjorling.com>
To: BIND-Users <bind-users at isc.org>
How would you define a script? Is a sequence of UNIX commands a
script?
You could of course do something on the order of (which can be given
all at once quite easily using the ; as a command separator):
dig zonename @server soa +norec > tmp
dig zonename @server axfr 2>&1 | egrep -vi '(soa|serial|retry|expiry|minimum)$' >> tmp
named-checkzone zonename tmp && ( mv tmp zonefile ; rndc reload zonename )
NOTE: This is untested, but you get the idea. Always try it manually
before applying it to a production box.
Michael Kj%F6rling
On Feb 19 2002 13:51 -0000, Diego Balgera wrote:
> Hi Barry and all the others,
> your suggestion is interesting but there is a small draback. When you export
> a dns zone with dig, the SOA record is replicated twice (see the example
> below). This confuses the bind a little bit.
> Do you know how to remove the duplicated SOA record without writing scripts?
> Thank you in advance. Diego.
>
> @ 1S IN SOA bohrdns3.tb.opi1.it.
> root.bohrdns3.tb.opi1.it. ( 2002021419 ; serial
> 8H ; refresh
> 2H ; retry
> 1W ; expiry
> 1S ) ; minimum
> 1S IN NS bohrdns1.tb.opi1.it.
> 1S IN NS bohrdns2.tb.opi1.it.
> 1S IN NS bohrdns3.tb.opi1.it.
> rac000c.lac8214 1h6m40s IN A 10.10.10.12
> rac00d2.lac9c40 1h6m40s IN A 10.20.10.101
> @ 1S IN SOA bohrdns3.tb.opi1.it.
> root.bohrdns3.tb.opi1.it. ( 2002021419 ; serial
> 8H ; refresh
> 2H ; retry
> 1W ; expiry
> 1S ) ; minimum
>
> ;; Received 7 answers (7 records).
> ;; FROM: bohrdns2 to SERVER: 10.20.10.12
> ;; WHEN: Tue Feb 19 15:22:41 2002
More information about the bind-users
mailing list