Unbound DNS Server for forwarding requests from pi-hole to ISP or upstream cloudflared workloads.
1.8K
Unbound DNS Server for forwarding requests from pi-hole to ISP or upsrteam cloudflared workloads.
2024/04/07 - Converted to using alpine base over ubuntu. Tag v20 is final ubuntu base
Forward to local cloudflared workloads OR ISP/pub DNS servers
forward-zone:
name: "."
forward-addr: 172.18.0.15@5553
forward-addr: 172.18.0.16@5553
forward-zone:
name: "."
forward-addr: 192.168.2.1
forward-addr: 1.1.1.1
#!/bin/sh
# Get Root Hints
wget -S -N https://www.internic.net/domain/named.cache -O /etc/unbound/root.hints 2>/dev/null
# Fetch new KSK Key
mkdir -p /var/lib/unbound
/usr/sbin/unbound-anchor -a /var/lib/unbound/root.key;
chown -R unbound:unbound /var/lib/unbound
service unbound start
tail -f /var/log/unbound.log;
## key for DNSSEC:
auto-trust-anchor-file: "/var/lib/unbound/root.key"
docker network create --subnet=172.18.0.0/23 --ip-range=172.18.1.0/24 --gateway 172.18.0.1 dns
docker run -d \
--name unbound1 -h unbound1 \
--network dns \
--restart=unless-stopped \
--ip 172.18.0.11 \
-e DEBIAN_FRONTEND="noninteractive" \
-v /docker/data/unbound/pi-hole.conf:/etc/unbound/unbound.conf.d/pi-hole.conf:ro \
lopezjo49/unbound:latest
docker run -d \
--name unbound2 -h unbound2 \
--network dns \
--restart=unless-stopped \
--ip 172.18.0.12 \
-e DEBIAN_FRONTEND="noninteractive" \
-v /docker/data/unbound/pi-hole.conf:/etc/unbound/unbound.conf.d/pi-hole.conf:ro \
lopezjo49/unbound:latest
x-unbound-common: &unb
build:
dockerfile: Dockerfile.alpine
image: lopezjo49/unbound:latest
restart: unless-stopped
env_file: .env
environment:
DEBIAN_FRONTEND: noninteractive
volumes:
- ./alpine-pi-hole.conf:/etc/unbound/unbound.conf:ro
services:
pihole1:
hostname: unbound1
container_name: unbound1
<<: *unb
networks:
dns:
ipv4_address: 172.18.0.11
pihole2:
hostname: unbound2
container_name: unbound2
<<: *unb
networks:
dns:
ipv4_address: 172.18.0.12
networks:
dns:
name: dns
external: true
delv www.nixcraft.com @172.18.0.11 -p 5335 AAAA +multi
delv www.nixcraft.com @172.18.0.11 -p 5335 +multi +dnssec
delv dnsworkshop.org @172.18.0.11 -p 5335 +multi +vtrace
delv www.nixcraft.com @172.18.0.11 -p 5335 +multi +vtrace
docker run -d \
--name doh1 -h doh1 \
--network dns \
--ip 172.18.0.15 \
-p 3338:3338 \
-e TZ="America/New_York" \
-e DEBIAN_FRONTEND="noninteractive" \
-e TUNNEL_DNS_UPSTREAM="https://1.1.1.2/dns-query,https://1.0.0.2/dns-query" \
-e TUNNEL_DNS_ADDRESS=0.0.0.0 \
-e TUNNEL_DNS_PORT=5553 \
-e TUNNEL_METRICS=0.0.0.0:3338 \
--restart=always \
cloudflare/cloudflared:latest proxy-dns
docker run -d \
--name doh2 -h doh2 \
--network dns \
--ip 172.18.0.16 \
-p 3339:3339 \
-e TZ="America/New_York" \
-e DEBIAN_FRONTEND="noninteractive" \
-e TUNNEL_DNS_UPSTREAM="https://1.1.1.2/dns-query,https://1.0.0.2/dns-query" \
-e TUNNEL_DNS_ADDRESS=0.0.0.0 \
-e TUNNEL_DNS_PORT=5553 \
-e TUNNEL_METRICS=0.0.0.0:3339 \
--restart=always \
cloudflare/cloudflared:latest proxy-dns
x-defaults: &default_config
image: cloudflare/cloudflared:latest
restart: always
env_file: .env
entrypoint: ["cloudflared", "proxy-dns"]
services:
doh1:
<<: *default_config
container_name: doh1
hostname: doh1
ports:
- 3338:3338
environment:
- "TUNNEL_METRICS=0.0.0.0:3338"
networks:
dns:
ipv4_address: 172.18.0.15
doh2:
<<: *default_config
container_name: doh2
hostname: doh2
ports:
- 3339:3339
environment:
- "TUNNEL_METRICS=0.0.0.0:3339"
networks:
dns:
ipv4_address: 172.18.0.16
networks:
dns:
name: dns
external: true
env_file:
COMPOSE_PROJECT=cloudflare
export DEBIAN_FRONTEND="noninteractive"
export TZ="America/New_York"
export TUNNEL_DNS_UPSTREAM="https://CHANGETHIS.cloudflare-gateway.com/dns-query,https://1.0.0.2/dns-query"
export TUNNEL_DNS_ADDRESS="0.0.0.0"
export TUNNEL_DNS_PORT=5553
Not For production or commercial use. Home network repo.
Content type
Image
Digest
sha256:377e3f915…
Size
10.5 MB
Last updated
27 days ago
docker pull lopezjo49/unbound