<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://workwiki.in/index.php?action=history&amp;feed=atom&amp;title=Bulk_edits_to_your_DNS_Zones</id>
	<title>Bulk edits to your DNS Zones - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://workwiki.in/index.php?action=history&amp;feed=atom&amp;title=Bulk_edits_to_your_DNS_Zones"/>
	<link rel="alternate" type="text/html" href="https://workwiki.in/index.php?title=Bulk_edits_to_your_DNS_Zones&amp;action=history"/>
	<updated>2026-06-05T20:32:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://workwiki.in/index.php?title=Bulk_edits_to_your_DNS_Zones&amp;diff=127&amp;oldid=prev</id>
		<title>Qljca: Created page with &quot;1. To back up all zones, run the following command: &lt;pre&gt; cp -rf /var/named{,.backup} &lt;/pre&gt;  2. Replace the nameservers used. In the following examples, we will use ns1.olddomain.tld and ns2.olddomain.tldas the current nameservers, and ns1/2.newddomain.tldfor the updated records, be sure to update the oldns and newns variables. &lt;pre&gt; oldns=&quot;ns1.olddomain.tld&quot;; newns=&quot;ns1.newdomain.tld&quot; ; find /var/named/*.db -exec perl -pi -e &quot;s/(?&lt;=IN\s\NS\s)$oldns/$newns/g&quot; &#039;{}&#039; \; &lt;/...&quot;</title>
		<link rel="alternate" type="text/html" href="https://workwiki.in/index.php?title=Bulk_edits_to_your_DNS_Zones&amp;diff=127&amp;oldid=prev"/>
		<updated>2024-06-20T05:33:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;1. To back up all zones, run the following command: &amp;lt;pre&amp;gt; cp -rf /var/named{,.backup} &amp;lt;/pre&amp;gt;  2. Replace the nameservers used. In the following examples, we will use ns1.olddomain.tld and ns2.olddomain.tldas the current nameservers, and ns1/2.newddomain.tldfor the updated records, be sure to update the oldns and newns variables. &amp;lt;pre&amp;gt; oldns=&amp;quot;ns1.olddomain.tld&amp;quot;; newns=&amp;quot;ns1.newdomain.tld&amp;quot; ; find /var/named/*.db -exec perl -pi -e &amp;quot;s/(?&amp;lt;=IN\s\NS\s)$oldns/$newns/g&amp;quot; &amp;#039;{}&amp;#039; \; &amp;lt;/...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;1. To back up all zones, run the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp -rf /var/named{,.backup}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Replace the nameservers used. In the following examples, we will use ns1.olddomain.tld and ns2.olddomain.tldas the current nameservers, and ns1/2.newddomain.tldfor the updated records, be sure to update the oldns and newns variables.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
oldns=&amp;quot;ns1.olddomain.tld&amp;quot;; newns=&amp;quot;ns1.newdomain.tld&amp;quot; ; find /var/named/*.db -exec perl -pi -e &amp;quot;s/(?&amp;lt;=IN\s\NS\s)$oldns/$newns/g&amp;quot; &amp;#039;{}&amp;#039; \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the command a second time, substituting ns1 for ns2.&lt;br /&gt;
&lt;br /&gt;
4. To update the SOA record, run the following command. The SOA record will contain your ns1 nameserver&amp;#039;s name, so ensure the variables are updated appropriately.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
oldns=&amp;quot;ns1.olddomain.tld&amp;quot;; newns=&amp;quot;ns1.newdomain.tld&amp;quot; ; find /var/named/*.db -exec perl -pi -e &amp;quot;s/$oldns/$newns/g if /SOA/&amp;quot; &amp;#039;{}&amp;#039; \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Update the serial records for all modified DNS zones:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /var/named/*.db -mtime -1 -exec perl -pi -e &amp;#039;if (/^\s+(\d{10})\s+;\s?(?i)serial/i) { my $i = $1+1; s/$1/$i/;}&amp;#039; &amp;#039;{}&amp;#039; \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. Restart the DNS service to apply changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/scripts/restartsrv_named&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. Verify that the zones were updated correctly.&lt;br /&gt;
&lt;br /&gt;
8. (Optional) If DNS Clustering is enabled, sync all zones:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/scripts/dnscluster syncall&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Qljca</name></author>
	</entry>
</feed>