<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>From:</b> bind-users <bind-users-bounces@lists.isc.org> on behalf of Ondřej Surý <ondrej@isc.org><br>
<b>Sent:</b> Wednesday, January 27, 2021 8:29 AM<br>
<b>To:</b> Greg Donohoe <dubgregd@gmail.com><br>
<b>Cc:</b> bind-users@lists.isc.org <bind-users@lists.isc.org><br>
<b>Subject:</b> Re: Reverse zone reformatting after nsupdate execution</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">You might want to change `masterfile-style` configuration option:<br>
<br>
<a href="https://bind9.readthedocs.io/en/latest/reference.html?highlight=masterfile-style#tuning">https://bind9.readthedocs.io/en/latest/reference.html?highlight=masterfile-style#tuning</a><br>
<br>
Ondrej<br>
--<br>
Ondřej Surý (He/Him)<br>
ondrej@isc.org<br>
<br>
> On 27. 1. 2021, at 14:23, Ondřej Surý <ondrej@isc.org> wrote:<br>
> <br>
> Greg,<br>
> <br>
> there’s nothing wrong with the zone contents. $ORIGIN means “now append this to every name not ending with dot”.<br>
> <br>
> Ondřej<br>
> --<br>
> Ondřej Surý — ISC (He/Him)<br>
> <br>
>> On 27. 1. 2021, at 14:06, Greg Donohoe <dubgregd@gmail.com> wrote:<br>
>> <br>
>> <br>
>> Hello. I am hoping that someone can help me to figure out the cause of an issue I am seeing when running nsupdate on my BIND9 server.<br>
>> Below you will find all the the details as to how my server is configured and also the nsupdate commands that I am running.<br>
>> <br>
>> The issue I am seeing is that I have configured a /16 10.10.in-addr.arpa reverse zone, however when I execute nsupdate the 10.10.in-addr.arpa.dns zone file re formats the $ORIGIN to a /24 156.10.10.in-addr.arpa.<br>
>> This appears to be an issue with nsupdate rather than BIND itself as I can manually amend the 10.10.in-addr.arpa.dns zone file whcih always remains in a /16 format.<br>
>> <br>
>> Please see below for details and if you need any further information please let me know.<br>
>> <br>
>> ###############################<br>
>> named.conf<br>
>> ###############################<br>
>> greg@hp-linux:/etc/bind$ cat named.conf<br>
>> ##  OPTIONS<br>
>> options {<br>
>> directory "/var/cache/bind";<br>
>> <br>
>>         recursion no;<br>
>> listen-on port 53 { any; };<br>
>> allow-query  { any; };<br>
>> allow-update { any; };<br>
>> <br>
>> forwarders {<br>
>> 10.10.8.120;<br>
>> 10.196.207.11;<br>
>> };<br>
>> <br>
>> dnssec-validation auto;<br>
>> <br>
>> auth-nxdomain no;    # conform to RFC1035<br>
>> listen-on-v6 { any; };<br>
>> };<br>
>> <br>
>> <br>
>> ## ZONES<br>
>> # Zone statement for forward DNS lookups<br>
>> zone "example.com" IN {<br>
>>     type master;<br>
>>     file "/etc/bind/master/example.com.dns";<br>
>>     allow-update { any; };<br>
>> };<br>
>> zone "10.10.in-addr.arpa"  IN  {<br>
>>     type master;<br>
>>     file "/etc/bind/master/10.10.in-addr.arpa.dns";<br>
>>     allow-update { any; };<br>
>> };<br>
>> <br>
>> ###################################################<br>
>> The batch.txt file I use to run nsupdate<br>
>> ###################################################<br>
>> server 127.0.0.1<br>
>> zone example.com<br>
>> update add test.example.com 86400 IN A 10.10.156.37<br>
>> send<br>
>> server 127.0.0.1<br>
>> zone 10.10.in-addr.arpa.<br>
>> update add 37.156.10.10.in-addr.arpa. 86400 IN PTR test.example.com<br>
>> send<br>
>> server 127.0.0.1<br>
>> zone example.com<br>
>> update add test1.example.com 86400 IN A 10.10.156.38<br>
>> send<br>
>> server 127.0.0.1<br>
>> zone 10.10.in-addr.arpa.<br>
>> update add 38.156.10.10.in-addr.arpa. 86400 IN PTR test1.example.com<br>
>> send<br>
>> <br>
>> ######################################################<br>
>> nsupdate debug output<br>
>> ######################################################<br>
>> greg@hp-linux:/etc/bind/master$ nsupdate -D -v batch1.txt<br>
>> setup_system()<br>
>> reset_system()<br>
>> user_interaction()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> evaluate_update()<br>
>> update_addordelete()<br>
>> do_next_command()<br>
>> start_update()<br>
>> send_update()<br>
>> Sending update to 127.0.0.1#53<br>
>> show_message()<br>
>> Outgoing update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  15755<br>
>> ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;example.com. IN SOA<br>
>> <br>
>> ;; UPDATE SECTION:<br>
>> test.example.com. 86400 IN A 10.10.156.37<br>
>> <br>
>> update_completed()<br>
>> show_message()<br>
>> <br>
>> Reply from update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  15755<br>
>> ;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;example.com. IN SOA<br>
>> <br>
>> done_update()<br>
>> reset_system()<br>
>> user_interaction()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> evaluate_update()<br>
>> update_addordelete()<br>
>> do_next_command()<br>
>> start_update()<br>
>> send_update()<br>
>> Sending update to 127.0.0.1#53<br>
>> show_message()<br>
>> Outgoing update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  38067<br>
>> ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;10.10.in-addr.arpa. IN SOA<br>
>> <br>
>> ;; UPDATE SECTION:<br>
>> 37.156.10.10.in-addr.arpa. 86400 IN PTR test.example.com.<br>
>> <br>
>> update_completed()<br>
>> show_message()<br>
>> <br>
>> Reply from update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  38067<br>
>> ;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;10.10.in-addr.arpa. IN SOA<br>
>> <br>
>> done_update()<br>
>> reset_system()<br>
>> user_interaction()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> evaluate_update()<br>
>> update_addordelete()<br>
>> do_next_command()<br>
>> start_update()<br>
>> send_update()<br>
>> Sending update to 127.0.0.1#53<br>
>> show_message()<br>
>> Outgoing update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  22045<br>
>> ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;example.com. IN SOA<br>
>> <br>
>> ;; UPDATE SECTION:<br>
>> test1.example.com. 86400 IN A 10.10.156.38<br>
>> <br>
>> update_completed()<br>
>> show_message()<br>
>> <br>
>> Reply from update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  22045<br>
>> ;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;example.com. IN SOA<br>
>> <br>
>> done_update()<br>
>> reset_system()<br>
>> user_interaction()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> do_next_command()<br>
>> evaluate_update()<br>
>> update_addordelete()<br>
>> do_next_command()<br>
>> start_update()<br>
>> send_update()<br>
>> Sending update to 127.0.0.1#53<br>
>> show_message()<br>
>> Outgoing update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:   7571<br>
>> ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;10.10.in-addr.arpa. IN SOA<br>
>> <br>
>> ;; UPDATE SECTION:<br>
>> 38.156.10.10.in-addr.arpa. 86400 IN PTR test1.example.com.<br>
>> <br>
>> update_completed()<br>
>> show_message()<br>
>> <br>
>> Reply from update query:<br>
>> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:   7571<br>
>> ;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0<br>
>> ;; ZONE SECTION:<br>
>> ;10.10.in-addr.arpa. IN SOA<br>
>> <br>
>> done_update()<br>
>> reset_system()<br>
>> user_interaction()<br>
>> cleanup()<br>
>> Shutting down task manager<br>
>> shutdown_program()<br>
>> Shutting down request manager<br>
>> Destroy DST lib<br>
>> Destroying request manager<br>
>> Freeing the dispatchers<br>
>> Shutting down dispatch manager<br>
>> Destroying event<br>
>> Shutting down socket manager<br>
>> Shutting down timer manager<br>
>> Removing log context<br>
>> Destroying memory context<br>
>> greg@hp-linux:/etc/bind/master$ systemctl restart named.service<br>
>> <br>
>> ######################################################<br>
>> Forward zone file after the nsupdate<br>
>> ######################################################<br>
>> greg@hp-linux:/etc/bind/master$ cat example.com.dns<br>
>> $ORIGIN .<br>
>> $TTL 3600 ; 1 hour<br>
>> example.com IN SOA ns1.example.com. admin\.example.com. (<br>
>> 2          ; serial<br>
>> 900        ; refresh (15 minutes)<br>
>> 600        ; retry (10 minutes)<br>
>> 1209600    ; expire (2 weeks)<br>
>> 3600       ; minimum (1 hour)<br>
>> )<br>
>> NS ns1.example.com.<br>
>> $ORIGIN example.com.<br>
>> ns1 A 192.168.0.15<br>
>> $TTL 86400 ; 1 day<br>
>> test A 10.10.156.37<br>
>> test1 A 10.10.156.38<br>
>> <br>
>> ########################################################<br>
>> Reverse zone file after the update<br>
>> ########################################################<br>
>> greg@hp-linux:/etc/bind/master$ cat 10.10.in-addr.arpa.dns<br>
>> $ORIGIN .<br>
>> $TTL 3600 ; 1 hour<br>
>> 10.10.in-addr.arpa IN SOA ns1.example.com. admin\.example.com. (<br>
>> 2          ; serial<br>
>> 3600       ; refresh (1 hour)<br>
>> 600        ; retry (10 minutes)<br>
>> 1209600    ; expire (2 weeks)<br>
>> 3600       ; minimum (1 hour)<br>
>> )<br>
>> NS ns1.example.com.<br>
>> $ORIGIN 156.10.10.in-addr.arpa.<br>
>> $TTL 86400 ; 1 day<br>
>> 37 PTR test.example.com.<br>
>> 38 PTR test1.example.com.<br>
>> <br>
>> If any additional info is required please let me know and I will send it asap.<br>
>> <br>
>> Look for to your response.<br>
>> <br>
>> Rgds,<br>
>> Greg Donohoe.<br>
>> _______________________________________________<br>
>> Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users">https://lists.isc.org/mailman/listinfo/bind-users</a> to unsubscribe from this list<br>
>> <br>
>> ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.<br>
>> <br>
>> <br>
>> bind-users mailing list<br>
>> bind-users@lists.isc.org<br>
>> <a href="https://lists.isc.org/mailman/listinfo/bind-users">https://lists.isc.org/mailman/listinfo/bind-users</a><br>
<br>
</div>
</span></font></div>
</div>
<br>
<br>
<div style="background-color:#D5EAFF; border:1px dotted #003333; padding:.8em; ">
<span style="font-size:12pt;  font-family: 'Cambria','times new roman','garamond',serif; color:#ff0000;">Confidentiality Notice
</span><br>
<p style="font-size:9pt; line-height:10pt; font-family: 'Cambria','times roman',serif;">
This email including all attachments is confidential and intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify
 the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of
 this information is strictly prohibited. </p>
<br>
</div>
</body>
</html>