This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:bind9dns [2025/12/28 05:22] – oemb1905 | computing:bind9dns [2025/12/28 08:43] (current) – oemb1905 | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| * Configuring your Registrar' | * Configuring your Registrar' | ||
| - | This tutorial presumes you already have a working and sufficiently hardened | + | This tutorial presumes you already have three working and sufficiently hardened |
| ------------------------------------------- | ------------------------------------------- | ||
| Line 186: | Line 186: | ||
| </ | </ | ||
| - | Now that the family and cat website zone is created, we need to establish its DNS records | + | Now that the family and cat website zone is re-created, we can now establish its DNS records |
| <code bash> | <code bash> | ||
| Line 240: | Line 240: | ||
| At this point, we're still dealing strictly with bind9 and have not setup webmin or the automated clustering features. We will do that soon, but there' | At this point, we're still dealing strictly with bind9 and have not setup webmin or the automated clustering features. We will do that soon, but there' | ||
| + | <code bash> | ||
| cd / | cd / | ||
| dnssec-keygen -a ED25519 -b 256 -n ZONE haacksnetworking.com | dnssec-keygen -a ED25519 -b 256 -n ZONE haacksnetworking.com | ||
| Line 245: | Line 246: | ||
| SALT=$(openssl rand -hex 8) | SALT=$(openssl rand -hex 8) | ||
| dnssec-signzone -S -K / | dnssec-signzone -S -K / | ||
| + | </ | ||
| You can of course just run the '' | You can of course just run the '' | ||
| Line 254: | Line 256: | ||
| allow-transfer { 8.28.86.114; | allow-transfer { 8.28.86.114; | ||
| also-notify { 8.28.86.114; | also-notify { 8.28.86.114; | ||
| + | }; | ||
| </ | </ | ||
| Line 398: | Line 401: | ||
| {{ : | {{ : | ||
| {{ : | {{ : | ||
| + | |||
| + | Before we create our first master zone using webmin' | ||
| + | |||
| + | {{ : | ||
| Once you do that, we can now create a new master zone. Here's what that looks like. For me, all the default values are fine: | Once you do that, we can now create a new master zone. Here's what that looks like. For me, all the default values are fine: | ||
| Line 424: | Line 431: | ||
| </ | </ | ||
| - | The IPv6 addresses above did not populate despite me having those entered in webmin under Bind9 Server > Zone defaults. You can see them in that area below and you can see that a test.club domain lacks them despite being populated there. | + | The IPv6 addresses above did not populate despite me having those entered in webmin under Bind9 Server > Zone defaults. You can see them in that area below and you can see that a test.club domain lacks them despite being populated there as seen in the screenshot below: |
| {{ : | {{ : | ||
| + | |||
| + | This glitch is a bit annoying, but it is not strictly required for the zone to function as only IPv4 is sufficient. If, however, you want to add the IPv6 entries, you do so by navigating to Bind9 Server > Zone Name > Edit Zone Options and simply add them: | ||
| + | |||
| {{ : | {{ : | ||
| - | This glitch is a bit annoying, but it is not strictly required for the zone to function as only IPv4 is sufficient. It's also very easy to change, but simply adding the IPv6 entries to the zone options. | + | It is not required to change anything on the slaves because these are master node entries and the slaves don't require any of these blocks. The slaves, on the other hand, have created corresponding |
| <code bash> | <code bash> | ||
| Line 444: | Line 454: | ||
| file "/ | file "/ | ||
| }; | }; | ||
| - | </bash> | + | </code> |
| - | Again, as I mentioned earlier, webmin | + | Webmin |
| {{ : | {{ : | ||
| - | Set up rndc in webmin gui | + | Of course, you could also shell into the slaves and remove those transfer rules via the CLI, this is just to show that both methods work and are dealing with the exact same bind9 underbelly. Once we do that, we can !!FINALLY!! create A, AAAA, dmarc, spf, and or any other records we need. Here's what the zone's landing page looks like and what the record pages within it look like: |
| - | image of that | + | {{ : |
| - | + | {{ : | |
| - | Once we do that, we show examples of how to create A, AAAA, SPF, and dmarc. NOTE: Remember to test the populate with " | + | {{ :computing: |
| - | + | {{ : | |
| - | images of that stuff | + | |
| Now, we do some host testing again. Repeat host commands above | Now, we do some host testing again. Repeat host commands above | ||
| Line 464: | Line 473: | ||
| host cloudcommunity.club ns3.haacksnetworking.com | host cloudcommunity.club ns3.haacksnetworking.com | ||
| | | ||
| - | Once that's working, let's setup DNSSEC using the webmin gui on master ns1. | + | Once that's working, let's setup DNSSEC using the webmin gui on master ns1. To do that navigate to Bind9 DNS Server > Zone > Setup DNS Key: |
| - | image of that | + | {{ : |
| + | |||
| + | Once the DNSSEC key is created and the zone signed, you will, just like above, have to navigate over to your registrar and enter in the algorithm, digest, digest tag, and key tag. To see those values, just select Bind9 DNS Server > Zone > Setup DNS Key and instead | ||
| - | Add section above to use dig in order to verify | + | {{ : |
| + | |||
| + | As a final step, we can use the dig command | ||
| - | dig command | + | dig cloudcommunity.club DNSKEY +dnssec @8.28.86.113 |
| + | dig cloudcommunity.club DNSKEY +dnssec @8.28.86.114 | ||
| + | dig cloudcommunity.club DNSKEY +dnssec @8.28.86.115 | ||
| | | ||
| - | Verify what webmin is doing under the hood. Show examples of the slave entries it makes in named on ns2 and ns3 on the CLI but via webmin. Similarly, show a screen shot of the zone record file for cloudcommunity.club | + | Each node should report |
| + | |||
| + | <code bash> | ||
| + | ; <<>> | ||
| + | ;; global options: +cmd | ||
| + | ;; Got answer: | ||
| + | ;; ->> | ||
| + | ;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 | ||
| + | ;; WARNING: recursion requested but not available | ||
| + | |||
| + | ;; OPT PSEUDOSECTION: | ||
| + | ; EDNS: version: 0, flags: do; udp: 1232 | ||
| + | ; COOKIE: f9d0bef39e0c56da010000006950c6e270c6a99b26e97171 (good) | ||
| + | ;; QUESTION SECTION: | ||
| + | ;cloudcommunity.club. IN DNSKEY | ||
| + | |||
| + | ;; ANSWER SECTION: | ||
| + | cloudcommunity.club. 3600 IN DNSKEY 256 3 15 yCykkNhKUB0H3F7B+F1ydS6lmTaQAhRkVLgq6Fy6xWo= | ||
| + | cloudcommunity.club. 3600 IN DNSKEY 257 3 15 g61Yq+dJTUxZpQDvQfqqK59CUv3IsDXyO8Sy229YVic= | ||
| + | cloudcommunity.club. 3600 IN RRSIG DNSKEY 15 2 3600 20260123020922 20251224020922 188 cloudcommunity.club. sbVDXR4RZpR0s2eXn3wyyJ4JGO2AZpX/ | ||
| + | cloudcommunity.club. 3600 IN RRSIG DNSKEY 15 2 3600 20260123020922 20251224020922 30893 cloudcommunity.club. AjoUcCUneoXo/ | ||
| + | |||
| + | ;; Query time: 100 msec | ||
| + | ;; SERVER: 8.28.86.113# | ||
| + | ;; WHEN: Sat Dec 27 22:57:54 MST 2025 | ||
| + | ;; MSG SIZE rcvd: 402 | ||
| + | </ | ||
| + | |||
| + | === Part 4 - Optional Unbound Recursive Resolver === | ||
| + | |||
| + | Now that you can create any record you please and sign your zones/ | ||
| sudo apt install unbound | sudo apt install unbound | ||
| | | ||
| - | The full unbound tutorial, including lan-side setups, can be found here. For this setup, a simple config such as this should work: | + | The full unbound tutorial, including lan-side setups, can be found [[https:// |
| - | | + | |
| + | # Bind to localhost only | ||
| + | interface: 127.0.0.1 | ||
| + | interface: ::1 | ||
| + | port: 5335 | ||
| + | do-ip4: yes | ||
| + | do-ip6: yes | ||
| + | prefer-ip6: yes | ||
| + | access-control: | ||
| + | access-control: | ||
| + | access-control: | ||
| + | # Optimize for 8 cores | ||
| + | num-threads: | ||
| + | msg-cache-slabs: | ||
| + | rrset-cache-slabs: | ||
| + | infra-cache-slabs: | ||
| + | key-cache-slabs: | ||
| + | # Cache settings for high query volume | ||
| + | cache-max-ttl: | ||
| + | cache-min-ttl: | ||
| + | rrset-cache-size: | ||
| + | msg-cache-size: | ||
| + | key-cache-size: | ||
| + | neg-cache-size: | ||
| + | # Enable prefetch and expired responses | ||
| + | prefetch: yes | ||
| + | prefetch-key: | ||
| + | serve-expired: | ||
| + | serve-expired-ttl: | ||
| + | # DNSSEC validation for DANE | ||
| + | #do-dnssec: yes | ||
| + | harden-dnssec-stripped: | ||
| + | harden-referral-path: | ||
| + | harden-below-nxdomain: | ||
| + | harden-algo-downgrade: | ||
| + | # Performance tweaks | ||
| + | #so-rcvbuf: 4m | ||
| + | #so-sndbuf: 4m | ||
| + | edns-buffer-size: | ||
| + | outgoing-range: | ||
| + | num-queries-per-thread: | ||
| + | jostle-timeout: | ||
| + | # | ||
| + | # Logging (minimal) | ||
| + | verbosity: 1 | ||
| + | log-queries: | ||
| + | log-replies: | ||
| + | use-syslog: yes | ||
| + | # Security and privacy | ||
| + | hide-identity: | ||
| + | hide-version: | ||
| + | use-caps-for-id: | ||
| + | qname-minimisation: | ||
| + | harden-large-queries: | ||
| + | harden-glue: | ||
| + | aggressive-nsec: | ||
| + | # Protocol settings | ||
| + | do-tcp: yes | ||
| + | do-udp: yes | ||
| + | # Disable subnetcache | ||
| + | module-config: " | ||
| | | ||
| It's crucial to bind unbound to 5335 since bind9 is already listening on 53. In order to have local recursive queries use unbound, we need to hijack all outbound resolver queries to ''/ | It's crucial to bind unbound to 5335 since bind9 is already listening on 53. In order to have local recursive queries use unbound, we need to hijack all outbound resolver queries to ''/ | ||
| Line 509: | Line 614: | ||
| If you are interested in setting up one of these authoritative Bind9 DNS clusters that are configured to use either CLI or the convenient webmin interface, just hit me up on Matrix. I'm available here: | If you are interested in setting up one of these authoritative Bind9 DNS clusters that are configured to use either CLI or the convenient webmin interface, just hit me up on Matrix. I'm available here: | ||
| - | * [[https:// | + | * [[https:// |
| - | --- // | + | --- // |