Batch updating all DNS records on my Bind server

Tony Finch dot at dotat.at
Sat Apr 18 16:52:00 UTC 2020


@lbutlr <kremels at kreme.com> wrote:
>
> Is it possible to batch update all the domains? Looking at nsupdate it
> looks like I have to step through and do every domain individually.

An UPDATE request can change many records, so long as they are all in the
same zone, and so long as they fit in the 64KB limit of DNS message size.
I find one request is usually enough for routine changes, but if you are
doing a bulk update to a large zone, you will need to split the changes
across mulitiple update requests.

You might find nsdiff helpful, both to verify that your bulk changes are
what you expect, and because it will split large updates into multiple
requests automatically. It's still one-zone-at-a-time, though. A
quick-and-dirty starting point might be roughly

	dig axfr $zone |
	sed 's/oldprefix/newprefix/' |
	nsdiff $zone /dev/stdin |
	nsupdate -l

https://dotat.at/prog/nsdiff/

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
North Utsire, South Utsire: Variable 3 or less. Smooth or slight, occasionally
moderate at first. Fair. Good.


More information about the bind-users mailing list