Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
docker_notes:docker-dns [2023-05-30 Tue wk22 20:10] – baumkp | docker_notes:docker-dns [2024-12-29 Sun wk52 10:05] (current) – [References] baumkp | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
======Docker - DNS Server====== | ======Docker - DNS Server====== | ||
- | I propose | + | [[https:// |
+ | 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. | ||
- | <fs xx-large><fc #ff0000>Work in progress</ | + | =====Linux setup to forward packets===== |
+ | 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 '' | ||
+ | *net.ipv4.ip_forward = 1 | ||
+ | *net.ipv4.conf.all.proxy_arp = 1 | ||
+ | * '' | ||
+ | After applying these changes reboot or apply setting using '' | ||
+ | |||
+ | ====References==== | ||
+ | *[[https:// | ||
+ | |||
+ | =====Bind9 Controls===== | ||
+ | *''/ | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *From [[https:// | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | |||
+ | 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. | ||
+ | |||
+ | =====bind9 Docker setup===== | ||
+ | ====bind9 docker image==== | ||
+ | I use the [[https:// | ||
+ | Notes | ||
+ | -I never had much success with the S6_KEEP_ENV when I played around with this earlier. | ||
+ | -Some of the packages are handy for debugging the container, but not required for normal package operation. | ||
+ | |||
+ | ++++Dockerfile| | ||
+ | < | ||
+ | |||
+ | ARG S6_OVERLAY_VERSION=3.1.6.2 | ||
+ | |||
+ | ADD https:// | ||
+ | RUN tar -C / -Jxpf / | ||
+ | ADD https:// | ||
+ | RUN tar -C / -Jxpf / | ||
+ | |||
+ | #ENV S6_KEEP_ENV=1 | ||
+ | #this keeps the environment variables | ||
+ | |||
+ | ENTRYPOINT ["/ | ||
+ | |||
+ | #add UID & GID | ||
+ | RUN \ | ||
+ | addgroup -g 99 named && \ | ||
+ | adduser -G named -u 99 -G named -D -S -h /dev/null named | ||
+ | |||
+ | RUN apk update && \ | ||
+ | apk --no-cache add \ | ||
+ | bind \ | ||
+ | bind-dnssec-tools \ | ||
+ | && \ | ||
+ | apk upgrade | ||
+ | #util-linux \ | ||
+ | #vim \ | ||
+ | #less \ | ||
+ | |||
+ | COPY user/* / | ||
+ | |||
+ | COPY s6-rc.d / | ||
+ | |||
+ | EXPOSE 53/tcp | ||
+ | EXPOSE 53/udp | ||
+ | EXPOSE 953/tcp | ||
+ | </ | ||
+ | ++++ | ||
+ | ====docker compose==== | ||
+ | A key point is the docker network is in host mode. (The ports are opened directly on the host and not routed from the docker internal network.) | ||
+ | |||
+ | ++++docker-compose.yml| | ||
+ | <code yaml> | ||
+ | services: | ||
+ | bind: | ||
+ | build: ./ | ||
+ | image: bind: | ||
+ | tty: true | ||
+ | stdin_open: true | ||
+ | container_name: | ||
+ | restart: ' | ||
+ | volumes: | ||
+ | - '/ | ||
+ | - '/ | ||
+ | - '/ | ||
+ | - '/ | ||
+ | network_mode: | ||
+ | |||
+ | command: / | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | =====DNSSEC===== | ||
+ | My local DNS server is a recursive caching type only. It take local (LAN) DNS queries and answers directly for any LAN name resolution, checks the cache for any external name resolution and then if not found locally or in cache checks the specified external DNS servers to resolve names. | ||
+ | |||
+ | For external name resolution Bind9 basically now defaults to automatic use of DNSSEC. | ||
+ | *'' | ||
+ | *'' | ||
+ | |||
+ | Equally important the following commands helps confirm that invalid DNS queries have failed and do not rerun invalid IP address, which would be security risk. If '' | ||
+ | |||
+ | Basic Bind9 DNSSEC configuration options | ||
+ | * The option (in ''/ | ||
+ | * The option '' | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | ====reference==== | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | ++++ old references | | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | ++++ | ||
+ | =====DNS over TLS (DoT)===== | ||
+ | DNS over TLS encrypts the DNS data so others can not see the specific DNS query and response. | ||
+ | |||
+ | It looks like Bind9 is still working on support for DNS over TLS (DoT) for forwarders. It may work on the current developer release 9.19. | ||
+ | |||
+ | *quad9 TLS config data: | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | |||
+ | |||
+ | |||
+ | ====reference==== | ||
+ | *Bind9 | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *QUAD9 | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | * | ||
+ | =====Testing DNS===== | ||
+ | My local recursive servers are '' | ||
+ | *Using '' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *Using '' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *Using '' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *'' | ||
+ | *Note that bind9 needs to be setup to allow-transfer from the requesting ip address, I include my LAN address range in the bind9 acl. | ||
+ | |||
+ | \\ | ||
+ | To find the version of bind9 used, anywhere from the LAN: | ||
+ | *'' | ||
+ | *'' | ||
+ | =====Public DNS Provideders===== | ||
+ | See internal webpage [[https:// | ||
=====References===== | =====References===== | ||
| | ||
| | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
<- docker_notes: | <- docker_notes: |