{"id":79090,"date":"2026-11-17T01:59:57","date_gmt":"2026-11-17T01:59:57","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79090"},"modified":"2026-11-17T01:59:57","modified_gmt":"2026-11-17T01:59:57","slug":"linux-advanced-05-dns","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79090","title":{"rendered":"Linux Advanced 05 \u2014 Authoritative DNS with BIND"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 5 of 9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Build an authoritative forward zone and distinguish an authoritative answer, NXDOMAIN, and no response.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The site&#8217;s Ubuntu DNS walkthrough uses the example.test zone and BIND. This lab starts an unprivileged instance on 127.0.0.1:1053. Install BIND tools from your distro for named, named-checkconf, named-checkzone, and dig. Leave system resolver settings unchanged. An authoritative server answers for its own zone. A recursive resolver searches on a client&#8217;s behalf. This instance deliberately does not recurse.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If an AppArmor or other system policy blocks the temporary path, use a supported custom instance or an approved lab VM. Do not deactivate system protections to make a fixture work.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Write and validate the zone<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>lab=$(mktemp -d)\ncd &quot;$lab&quot; || exit\ncat &gt; zone.db &lt;&lt;'EOF'\n$TTL 300\n@ IN SOA ns.example.test. hostmaster.example.test. (\n  2026111601 3600 900 1209600 300 )\n@   IN NS ns.example.test.\nns  IN A 192.0.2.53\napp IN A 192.0.2.20\nEOF\ncat &gt; named.conf &lt;&lt;EOF\noptions {\n  directory &quot;$lab&quot;;\n  listen-on port 1053 { 127.0.0.1; };\n  listen-on-v6 { none; };\n  recursion no;\n  pid-file &quot;$lab\/named.pid&quot;;\n};\ncontrols { };\nzone &quot;example.test&quot; {\n  type primary;\n  file &quot;zone.db&quot;;\n};\nEOF\nnamed-checkconf &quot;$lab\/named.conf&quot;\nnamed-checkzone example.test &quot;$lab\/zone.db&quot;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zone example.test\/IN: loaded serial 2026111601\nOK<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A good named-checkconf often prints nothing. Dots after fully qualified names stop them being treated as relative. The records use documentation addresses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Start the server and query two names<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Terminal A, in the same shell as the previous block:\nnamed -g -c &quot;$lab\/named.conf&quot;\n# Terminal B, after the instance is ready:\ndig @127.0.0.1 -p 1053 +norecurse app.example.test A +noall +comments +answer\ndig @127.0.0.1 -p 1053 +norecurse missing.example.test A +noall +comments\n# Press Ctrl-C in Terminal A when finished.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: ...\n;; flags: qr aa; ...\napp.example.test.  300  IN  A  192.0.2.20\n;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NXDOMAIN, id: ...\n;; flags: qr aa; ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">An existing name without a record of the requested type can instead return NOERROR with no answer records. Do not use dig +short when you need to see that distinction.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>What does aa indicate?<\/li>\n\n\n<li>Should the lab server recurse for arbitrary names?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Add docs.example.test with address 192.0.2.21. What else changes in the zone?<\/li>\n\n\n<li>What may happen if the NS target omits the final dot?<\/li>\n\n\n<li>How can you distinguish NXDOMAIN from a timeout?<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>What does aa indicate?<\/strong><br><strong>Answer<\/strong> \u2014 The responding server marked the answer authoritative.<\/li>\n\n\n<li><strong>Should the lab server recurse for arbitrary names?<\/strong><br><strong>Answer<\/strong> \u2014 No. Recursion is deliberately off.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Add docs.example.test with address 192.0.2.21. What else changes in the zone?<\/strong><br><strong>Answer<\/strong> \u2014 Add docs IN A 192.0.2.21 and increment the SOA serial. Revalidate, restart the lab instance, and query the new record.<\/li>\n\n\n<li><strong>What may happen if the NS target omits the final dot?<\/strong><br><strong>Answer<\/strong> \u2014 The server may append the zone origin to the relative target.<\/li>\n\n\n<li><strong>How can you distinguish NXDOMAIN from a timeout?<\/strong><br><strong>Answer<\/strong> \u2014 NXDOMAIN is a received DNS response code. A timeout means a usable reply was not received in time.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78519\">Step by step DNS Server installation in ubuntu in a fresh VM<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=22417\">Linux Commands Demo DNS related, Ubuntu #Root #By Sayed Ahmed #RHCSA<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=68590\">DNS: How to configure a DNS server in Linux #74<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78439\">Basic Commands for Networking in Linux<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical references<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/ubuntu.com\/server\/docs\/how-to\/networking\/install-dns\/\">Ubuntu Server guide to BIND<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 04 \u2014 Firewall Zones and Runtime Rules. Next lesson 06 \u2014 DHCP Leases and a Kea Lab.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 5 of 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build an authoritative forward zone and distinguish an authoritative answer, NXDOMAIN, and no response.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1992],"tags":[],"class_list":["post-79090","post","type-post","status-publish","format-standard","hentry","category-linux-advanced","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79090,"position":0},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79089,"url":"http:\/\/bangla.sitestree.com\/?p=79089","url_meta":{"origin":79090,"position":1},"title":"Linux Advanced 04 \u2014 Firewall Zones and Runtime Rules","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Identify the active zone and compare a timed runtime firewall rule with permanent policy.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79091,"url":"http:\/\/bangla.sitestree.com\/?p=79091","url_meta":{"origin":79090,"position":2},"title":"Linux Advanced 06 \u2014 DHCP Leases and a Kea Lab","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Validate a Kea DHCPv4 pool and verify a lease issued to a VM on an isolated segment.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78519,"url":"http:\/\/bangla.sitestree.com\/?p=78519","url_meta":{"origin":79090,"position":3},"title":"Step by step DNS Server installation in ubuntu in a fresh VM","author":"Author-Check- Article-or-Video","date":"September 28, 2025","format":false,"excerpt":"\"Nice \u2014 below is a complete, step-by-step, blog-ready guide to install and configure a simple authoritative + optional recursive BIND9 DNS server on a fresh Ubuntu VM. It\u2019s copyright-free and ready to paste into your notes or blog. Notes before you begin\u2022 This guide assumes Ubuntu 22.04 \/ 24.04 (netplan-based).\u2022\u2026","rel":"","context":"In &quot;Computer Networks&quot;","block_context":{"text":"Computer Networks","link":"http:\/\/bangla.sitestree.com\/?cat=1978"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79092,"url":"http:\/\/bangla.sitestree.com\/?p=79092","url_meta":{"origin":79090,"position":4},"title":"Linux Advanced 07 \u2014 Time Synchronization with chrony","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Distinguish clock display from synchronization and show whether chrony selected a source.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79093,"url":"http:\/\/bangla.sitestree.com\/?p=79093","url_meta":{"origin":79090,"position":5},"title":"Linux Advanced 08 \u2014 Apache Virtual Hosts and HTTPS","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Test Apache name-based routing locally and verify HTTPS with certificate and renewal checks.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79090"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79090\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79090"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}