{{tag>linux docker DNS bind9}}
======Docker - DNS Server======
[[https://www.hostinger.com/tutorials/what-is-dns|What Is DNS and How Does It Work – A Comprehensive Guide]]\\
I have been using Bind9 as my home LAN DNS for the past few years. I originally operated it on bare metal on my home router computer. In mid 2023 I successfully moved my Bind9 primary instance to my main home server in a container and created a slave instance in a container running on my home router computer. I created a Docker Bind9 Image using base Docker Alpine Linux images, with S6 init system.
The main router must be set to forward packets!
The ability to forward packets must be set / allowed, edit or add the following parameters in ''sudo vim /etc/sysctl.conf'':
*net.ipv4.ip_forward = 1
*net.ipv4.conf.all.proxy_arp = 1
* ''sudo sysctl net.ipv6.conf.all.forwarding=1'' similar for ipv6
After applying these changes reboot or apply setting using ''sudo sysctl -p /etc/sysctl.conf''
*''/usr/sbin/named -f -4'' to start the isc-bind9 application called named,
*''-f'' to run in foreground
*''-4'' to run ipv4 only
*''rndc stop'' to stop named - need to implement this in S6
*''rndc reload'' to reload the named configuration files
*''named-checkconf /etc/bind/named.conf''
*''named-checkzone kptree.net /etc/bind/db.kptree.net''
*''named-checkzone 1.168.192.in-addr.arpa /etc/bind/db.1.168.192''
*''cat /log/named/bind.log'' to list bind log file
*From [[https://serverfault.com/questions/401024/listing-all-zones-loaded-in-bind|Listing all zones loaded in BIND]]
*''rndc dumpdb -zones''
*''cat /var/bind/named_dump.db'' to see the database dump
*''named-checkconf -l'' does this option still exist?
*''named-checkconf -p'' for a flatened uncomment listing of the configuration files
I have setup a primary DNS server and secondary slave DNS server.
*The primary DNS server runs on my main home server, it is the master
*The secondary DNS server runs on my router, it is set up as a slave server from the primary server and reads the zone files from the master when available.
====References====
*[[https://askubuntu.com/questions/311053/how-to-make-ip-forwarding-permanent|How to make IP forwarding permanent?]]
=====References=====
*KPTree.net's bare metal implementation of [[linux_router:dns_dhcp|dns - dhcp]], based upon ISC Bind9 and DHCP on Debian 10 (was originally Ubuntu).
*[[https://www.zytrax.com/books/dns/|DNS for Rocket Scientists]]
*[[https://hub.docker.com/r/mjkaye/bind9-alpine|mjkaye/bind9-alpine]]
*[[https://kb.isc.org/docs/aa-00768|Getting started with BIND - how to build and run named with a basic recursive configuration]]
*[[https://www.digitalocean.com/community/tutorials/how-to-configure-bind-as-a-caching-or-forwarding-dns-server-on-ubuntu-16-04|How To Configure Bind as a Caching or Forwarding DNS Server on Ubuntu 16.04]]
*[[https://stackoverflow.com/questions/11153958/how-to-enable-named-bind-dns-full-logging|How to enable named/bind/DNS full logging? [closed]]]
*[[https://á.se/dnssec-bind9-alpine/|dnssec, Bind9 on Alpine]]
*[[https://www.isc.org/bind/|ISC Bind9]]
*[[https://hub.docker.com/r/internetsystemsconsortium/bind9|Github internetsystemsconsortium/bind9]]
*[[https://serverspace.us/support/help/bind9-as-a-secondary-dns-server-on-ubuntu/|How to Configure BIND9 as a Secondary DNS Server on Ubuntu 20.04]]
*[[https://askubuntu.com/questions/152593/command-line-to-list-dns-servers-used-by-my-system|Command-line to list DNS servers used by my system]]
*[[https://computingforgeeks.com/configure-slave-bind-dns-server-on-ubuntu/|Configure Slave BIND DNS Server on Ubuntu 22.04|20.04]]
<- docker_notes:docker-mailserver|Back ^ docker_notes:index|Start page ^ docker_notes:docker-dhcp|Next ->