<p>DNScode is a project to help simplify DNS zone management, when using plain text files with servers like BIND and NSD. It provides a framework for programmatically generating zone files with Python, allowing for more flexability, compared to other DNS as code solutions.</p>
<h1><aclass="anchor"id="autotoc_md4"></a>
Installation</h1>
<divclass="fragment"><divclass="line"> bash</div>
<divclass="line"># Create working directory</div>
<divclass="line">mkdir dnsproject</div>
<divclass="line">cd dnsproject</div>
<divclass="line"></div>
<divclass="line"># Create virtual envrionment (optional, but highly recomended)</div>
<divclass="line">python3 -m venv .venv</div>
<divclass="line">source .venv/bin/activate</div>
<divclass="line"></div>
<divclass="line"># Install the dnscode package</div>
<divclass="line">pip install dnscode</div>
</div><!-- fragment --><h1><aclass="anchor"id="autotoc_md5"></a>
Usage</h1>
<p>Import the dnscode package into a python script, create a zone object, then add records into the zone. Records can be added either via helper functions in the <ahref="https://dnscode.minecraftchest1.us/classdnscode_1_1dnscode_1_1Zone">dnscode.Zone</a> class, or by manually creating record objects and adding them through <ahref="https://dnscode.minecraftchest1.us/classdnscode_1_1dnscode_1_1Zone#a338bc686b7c7db2cab7827996a3f23f3">dnscode.Zone.add()</a>. Both methods are shown in the example below.</p>
<p>Once the zone is setup, you can save it as a text file using <ahref="https://dnscode.minecraftchest1.us/classdnscode_1_1dnscode_1_1Zone#adfe5442ed2137a324f1c5ba676ba2043">dnscode.Zone.save_file()</a>. Currently, it also outputs to to STDOUT. See <ahref="https://code.minecraftchest1.us/minecraftchest1/dnscode/issues/5">https://code.minecraftchest1.us/minecraftchest1/dnscode/issues/5</a> for details.</p>
<p>API docs at <ahref="https://dnscode.minecraftchest1.us/classdnscode_1_1dnscode_1_1Zone">https://dnscode.minecraftchest1.us/classdnscode_1_1dnscode_1_1Zone</a></p>
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<ul>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.12.0 </li>