title: Populate Samba AD reverse zone
body: <p>The problem is to populate reverse zone PTR records as found in Forward DNS zones in internal samba4 DNS implementation.</p>
  
  <p>The forward zone output can be captured with the following command:</p>
  
  <pre><code>samba-tool dns query adserver example.com @ A
  </code></pre>
  
  <p>The output has the following format:</p>
  
  <pre><code>  Name=, Records=0, Children=0
    Name=host1, Records=1, Children=0
      A: 192.168.0.12 (flags=f0, serial=2, ttl=900)
    Name=host2, Records=1, Children=0
      A: 192.168.0.13 (flags=f0, serial=5, ttl=900)
  </code></pre>
  
  <p>What is needed is the script to automate creation of reverse zone records.</p>