{"id":37,"date":"2007-06-07T17:18:13","date_gmt":"2007-06-08T00:18:13","guid":{"rendered":"http:\/\/www.dreness.com\/blog\/archives\/37"},"modified":"2007-06-11T16:06:06","modified_gmt":"2007-06-11T23:06:06","slug":"dns-zone-file-record-generation-script","status":"publish","type":"post","link":"https:\/\/dreness.com\/blog\/archives\/37","title":{"rendered":"DNS Zone File record generation script"},"content":{"rendered":"<p>In wrote the following as part of my response to <a href=\"http:\/\/lists.apple.com\/archives\/Macos-x-server\/2007\/Jun\/msg00097.html\">this<\/a>.<\/p>\n<pre>#!\/usr\/bin\/perl -w\r\nuse strict;\r\n\r\n# Place the first three octets here.\r\nmy $AddressPrefix = \"10.0.1\";\r\n\r\n# Define the range of numbers, inclusive.\r\nmy $range = \"2 .. 10\";\r\n\r\n# Your fqdn suffix here, e.g. \"foo.com\" or \"k12.fl.us.gov\"\r\nmy $tld = \"937\";\r\n\r\n# Need a backwards representation for PTR records\r\nmy $octets = join(\".\", reverse(split(\/\\.\/, $AddressPrefix)));\r\n\r\n# For our resulting address and ptr records\r\nmy @A, my @PTR = \"\";\r\n\r\nforeach my $n ( eval $range ) {\r\npush @A, \"dhcp$n IN A $AddressPrefix.$n\";\r\npush @PTR, \"$n.$octets.in-addr.arpa. IN PTR dhcp$n.$tld.\";\r\n}\r\n\r\nprint \"Forward zone address records:\\n\";\r\nprint \"$_\\n\" for @A;\r\nprint \"\\nReverse zone ptr records:\";\r\nprint \"$_\\n\" for @PTR;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In wrote the following as part of my response to this. #!\/usr\/bin\/perl -w use strict; # Place the first three octets here. my $AddressPrefix = &#8220;10.0.1&#8221;; # Define the range of numbers, inclusive. my $range = &#8220;2 .. 10&#8221;; # &hellip; <a href=\"https:\/\/dreness.com\/blog\/archives\/37\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-os-x-server","category-scripts"],"_links":{"self":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}