{"id":9993,"date":"2023-04-18T20:35:20","date_gmt":"2023-04-19T01:35:20","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=9993"},"modified":"2023-04-20T12:51:21","modified_gmt":"2023-04-20T17:51:21","slug":"isc-bind-converting-secondary-zone-to-primary","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=9993","title":{"rendered":"ISC Bind &#8211; Converting Secondary Zone to Primary"},"content":{"rendered":"<p>Our power went out on Monday and, unfortunately, the SSD on the server with all of our VMs got corrupted. The main server has ISC Bind configured to host all of our internal DNS zones as secondaries &#8230; but, a day after the primary DNS server went down, those copies fell over. Luckily, you can convert a secondary zone to primary. The <em>problem<\/em> is that the cached copy of the zone was &#8230; funky binary stuff.<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9994\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone.png\" alt=\"\" width=\"876\" height=\"353\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone.png 876w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone-300x121.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone-768x309.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/04\/ISCBind-BinaryRepresentationOfZone-750x302.png 750w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/a><\/p>\n<p>Luckily there&#8217;s an executable to convert this into a text zone file &#8212; named-compilezone<\/p>\n<p>-f raw -F text -o output_file_name zone_name input_file_name<\/p>\n<p>So, to covert my rushworth.us zone:<\/p>\n<p><tt>named-compilezone -f raw -F text -o rushworth.us.db rushworth.us rushworth.us.db.bin<\/tt><\/p>\n<p>Then, in the named.conf file, change the zone type to &#8220;master&#8221; and remark out the line indicating which the masters are. Change the &#8220;files&#8221; line to the newly created file. If you haven&#8217;t already done so, add &#8220;allow-query {any; };&#8221; so clients can actually query the zone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our power went out on Monday and, unfortunately, the SSD on the server with all of our VMs got corrupted. The main server has ISC Bind configured to host all of our internal DNS zones as secondaries &#8230; but, a day after the primary DNS server went down, those copies fell over. Luckily, you can &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[99,100,313,314],"class_list":["post-9993","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-bind","tag-dns","tag-isc-bind","tag-named"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9993"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9993\/revisions"}],"predecessor-version":[{"id":9995,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9993\/revisions\/9995"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}