Add Unbound as better DNSSEC enabled resolver
This commit is contained in:
parent
db01b08926
commit
b367ec0ace
21
data/Dockerfiles/unbound/Dockerfile
Normal file
21
data/Dockerfiles/unbound/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM alpine:3.6
|
||||||
|
|
||||||
|
LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
|
||||||
|
|
||||||
|
RUN apk add --update --no-cache \
|
||||||
|
curl \
|
||||||
|
unbound \
|
||||||
|
bash \
|
||||||
|
openssl \
|
||||||
|
drill \
|
||||||
|
&& curl -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache \
|
||||||
|
&& chown root:unbound /etc/unbound \
|
||||||
|
&& chmod 775 /etc/unbound
|
||||||
|
|
||||||
|
COPY unbound.conf /etc/unbound/unbound.conf
|
||||||
|
|
||||||
|
EXPOSE 53/udp 53/tcp
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
9
data/Dockerfiles/unbound/docker-entrypoint.sh
Executable file
9
data/Dockerfiles/unbound/docker-entrypoint.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
unbound-control-setup
|
||||||
|
echo "Receiving anchor key..."
|
||||||
|
/usr/sbin/unbound-anchor -a /etc/unbound/trusted-key.key
|
||||||
|
echo "Receiving root hints..."
|
||||||
|
curl -#o /etc/unbound/root.hints https://www.internic.net/domain/named.cache
|
||||||
|
|
||||||
|
exec "$@"
|
28
data/Dockerfiles/unbound/unbound.conf
Normal file
28
data/Dockerfiles/unbound/unbound.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
server:
|
||||||
|
verbosity: 2
|
||||||
|
interface: 0.0.0.0
|
||||||
|
interface: ::0
|
||||||
|
logfile: /dev/stdout
|
||||||
|
do-ip4: yes
|
||||||
|
do-ip6: yes
|
||||||
|
do-udp: yes
|
||||||
|
do-tcp: yes
|
||||||
|
do-daemonize: no
|
||||||
|
access-control: 172.22.1.0/24 allow
|
||||||
|
access-control: fd4d:6169:6c63:6f77::/64 allow
|
||||||
|
directory: "/etc/unbound"
|
||||||
|
username: unbound
|
||||||
|
auto-trust-anchor-file: trusted-key.key
|
||||||
|
private-address: 10.0.0.0/8
|
||||||
|
private-address: 172.16.0.0/12
|
||||||
|
private-address: 192.168.0.0/16
|
||||||
|
private-address: 169.254.0.0/16
|
||||||
|
private-address: fd00::/8
|
||||||
|
private-address: fe80::/10
|
||||||
|
root-hints: "/etc/unbound/root.hints"
|
||||||
|
remote-control:
|
||||||
|
control-enable: yes
|
||||||
|
server-key-file: /etc/unbound/unbound_server.key
|
||||||
|
server-cert-file: /etc/unbound/unbound_server.pem
|
||||||
|
control-key-file: /etc/unbound/unbound_control.key
|
||||||
|
control-cert-file: /etc/unbound/unbound_control.pem
|
@ -1,5 +1,24 @@
|
|||||||
version: '2.1'
|
version: '2.1'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
unbound-mailcow:
|
||||||
|
image: mailcow/unbound
|
||||||
|
command: /usr/sbin/unbound
|
||||||
|
depends_on:
|
||||||
|
mysql-mailcow:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "drill", "A", "servercow.de", "@127.0.0.1"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 5
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
mailcow-network:
|
||||||
|
ipv4_address: 172.22.1.254
|
||||||
|
aliases:
|
||||||
|
- bind9
|
||||||
|
|
||||||
mysql-mailcow:
|
mysql-mailcow:
|
||||||
image: mariadb:10.1
|
image: mariadb:10.1
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@ -16,6 +35,9 @@ services:
|
|||||||
- MYSQL_USER=${DBUSER}
|
- MYSQL_USER=${DBUSER}
|
||||||
- MYSQL_PASSWORD=${DBPASS}
|
- MYSQL_PASSWORD=${DBPASS}
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
aliases:
|
aliases:
|
||||||
@ -24,11 +46,13 @@ services:
|
|||||||
redis-mailcow:
|
redis-mailcow:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql-mailcow:
|
- unbound-mailcow
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
volumes:
|
||||||
- redis-vol-1:/data/
|
- redis-vol-1:/data/
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
aliases:
|
aliases:
|
||||||
@ -38,6 +62,9 @@ services:
|
|||||||
image: mailcow/clamd
|
image: mailcow/clamd
|
||||||
build: ./data/Dockerfiles/clamav
|
build: ./data/Dockerfiles/clamav
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
aliases:
|
aliases:
|
||||||
@ -52,8 +79,7 @@ services:
|
|||||||
/usr/bin/rspamd -f -u _rspamd -g _rspamd
|
/usr/bin/rspamd -f -u _rspamd -g _rspamd
|
||||||
"
|
"
|
||||||
depends_on:
|
depends_on:
|
||||||
nginx-mailcow:
|
- nginx-mailcow
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/conf/rspamd/override.d/:/etc/rspamd/override.d:ro
|
- ./data/conf/rspamd/override.d/:/etc/rspamd/override.d:ro
|
||||||
- ./data/conf/rspamd/local.d/:/etc/rspamd/local.d:ro
|
- ./data/conf/rspamd/local.d/:/etc/rspamd/local.d:ro
|
||||||
@ -61,6 +87,9 @@ services:
|
|||||||
- dkim-vol-1:/data/dkim
|
- dkim-vol-1:/data/dkim
|
||||||
- rspamd-vol-1:/var/lib/rspamd
|
- rspamd-vol-1:/var/lib/rspamd
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
hostname: rspamd
|
hostname: rspamd
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
@ -84,6 +113,9 @@ services:
|
|||||||
- DBPASS=${DBPASS}
|
- DBPASS=${DBPASS}
|
||||||
- MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
|
- MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
aliases:
|
aliases:
|
||||||
@ -93,8 +125,7 @@ services:
|
|||||||
image: mailcow/sogo
|
image: mailcow/sogo
|
||||||
build: ./data/Dockerfiles/sogo
|
build: ./data/Dockerfiles/sogo
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql-mailcow:
|
- unbound-mailcow
|
||||||
condition: service_healthy
|
|
||||||
environment:
|
environment:
|
||||||
- DBNAME=${DBNAME}
|
- DBNAME=${DBNAME}
|
||||||
- DBUSER=${DBUSER}
|
- DBUSER=${DBUSER}
|
||||||
@ -103,6 +134,9 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./data/conf/sogo/:/etc/sogo/
|
- ./data/conf/sogo/:/etc/sogo/
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
ipv4_address: 172.22.1.252
|
ipv4_address: 172.22.1.252
|
||||||
@ -113,8 +147,7 @@ services:
|
|||||||
image: mailcow/dovecot
|
image: mailcow/dovecot
|
||||||
build: ./data/Dockerfiles/dovecot
|
build: ./data/Dockerfiles/dovecot
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql-mailcow:
|
- unbound-mailcow
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/conf/dovecot:/usr/local/etc/dovecot
|
- ./data/conf/dovecot:/usr/local/etc/dovecot
|
||||||
- ./data/assets/ssl:/etc/ssl/mail/:ro
|
- ./data/assets/ssl:/etc/ssl/mail/:ro
|
||||||
@ -132,6 +165,9 @@ services:
|
|||||||
- "${POPS_PORT:-995}:995"
|
- "${POPS_PORT:-995}:995"
|
||||||
- "${SIEVE_PORT:-4190}:4190"
|
- "${SIEVE_PORT:-4190}:4190"
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
hostname: ${MAILCOW_HOSTNAME}
|
hostname: ${MAILCOW_HOSTNAME}
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
@ -142,8 +178,7 @@ services:
|
|||||||
image: mailcow/postfix
|
image: mailcow/postfix
|
||||||
build: ./data/Dockerfiles/postfix
|
build: ./data/Dockerfiles/postfix
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql-mailcow:
|
- unbound-mailcow
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/conf/postfix:/opt/postfix/conf
|
- ./data/conf/postfix:/opt/postfix/conf
|
||||||
- ./data/assets/ssl:/etc/ssl/mail/:ro
|
- ./data/assets/ssl:/etc/ssl/mail/:ro
|
||||||
@ -158,6 +193,9 @@ services:
|
|||||||
- "${SMTPS_PORT:-465}:465"
|
- "${SMTPS_PORT:-465}:465"
|
||||||
- "${SUBMISSION_PORT:-587}:587"
|
- "${SUBMISSION_PORT:-587}:587"
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
hostname: ${MAILCOW_HOSTNAME}
|
hostname: ${MAILCOW_HOSTNAME}
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
@ -167,9 +205,11 @@ services:
|
|||||||
memcached-mailcow:
|
memcached-mailcow:
|
||||||
image: memcached:alpine
|
image: memcached:alpine
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql-mailcow:
|
- unbound-mailcow
|
||||||
condition: service_healthy
|
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
aliases:
|
aliases:
|
||||||
@ -202,6 +242,9 @@ services:
|
|||||||
- "${HTTPS_BIND:-0.0.0.0}:${HTTPS_PORT:-443}:${HTTPS_PORT:-443}"
|
- "${HTTPS_BIND:-0.0.0.0}:${HTTPS_PORT:-443}:${HTTPS_PORT:-443}"
|
||||||
- "${HTTP_BIND:-127.0.0.1}:${HTTP_PORT:-80}:${HTTP_PORT:-80}"
|
- "${HTTP_BIND:-127.0.0.1}:${HTTP_PORT:-80}:${HTTP_PORT:-80}"
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
ipv4_address: 172.22.1.251
|
ipv4_address: 172.22.1.251
|
||||||
@ -213,6 +256,9 @@ services:
|
|||||||
- nginx-mailcow
|
- nginx-mailcow
|
||||||
image: mailcow/acme
|
image: mailcow/acme
|
||||||
build: ./data/Dockerfiles/acme
|
build: ./data/Dockerfiles/acme
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
# All domains to be included in the certificate
|
# All domains to be included in the certificate
|
||||||
environment:
|
environment:
|
||||||
- CONTAINERS_RESTART=mailcowdockerized_postfix-mailcow_1 mailcowdockerized_dovecot-mailcow_1 mailcowdockerized_nginx-mailcow_1
|
- CONTAINERS_RESTART=mailcowdockerized_postfix-mailcow_1 mailcowdockerized_dovecot-mailcow_1 mailcowdockerized_nginx-mailcow_1
|
||||||
@ -239,6 +285,9 @@ services:
|
|||||||
- sogo-mailcow
|
- sogo-mailcow
|
||||||
- php-fpm-mailcow
|
- php-fpm-mailcow
|
||||||
restart: always
|
restart: always
|
||||||
|
dns:
|
||||||
|
- 172.22.1.254
|
||||||
|
dns_search: mailcow-network
|
||||||
privileged: true
|
privileged: true
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
volumes:
|
volumes:
|
||||||
|
Loading…
Reference in New Issue
Block a user