switch to OpenDNS

This commit is contained in:
11notes
2019-03-15 14:13:00 +01:00
parent a61506dbe8
commit 4c4d6b4a7a
4 changed files with 47 additions and 41 deletions

View File

@@ -1,21 +1,24 @@
# ------ Header ------ #
FROM alpine:latest
# :: Header
FROM alpine:3.9
# // add bind
RUN apk update \
&& apk add --update bash \
&& apk add --no-cache bind
# :: Run
USER root
# // create directory for zone configuration files
RUN mkdir -p /var/zones \
# // delete default files
&& rm -R /etc/bind/*
RUN mkdir -p /bind/etc \
&& mkdir -p /bind/var
# // add default bind config for internal, external view + recursion
ADD ./named.conf /etc/bind/named.conf
RUN apk --update --no-cache add \
bash \
bind
# ------ define volumes ------ #
VOLUME ["/etc/bind", "/var/zones"]
RUN rm -R /etc/bind
# ------ entrypoint for container ------ #
CMD ["/usr/sbin/named", "-fg", "-c", "/etc/bind/named.conf"]
ADD ./source/named.conf /bind/etc/named.conf
ADD ./source/zones.conf /bind/etc/zones.conf
# :: Volumes
VOLUME ["/bind/etc", "/bind/var"]
# :: Start
USER named
CMD ["/usr/sbin/named", "-fg", "-c", "/bind/etc/named.conf"]

View File

@@ -1,25 +0,0 @@
options {
listen-on { any; };
directory "/etc/bind";
recursion no;
allow-notify { none; };
forwarders { 8.8.8.8; 8.8.4.4; };
version "0.0";
};
acl acl-internal {
10.0.0.0/8;
172.16.0.0/12;
192.168.0.0/16;
};
view "internal" {
match-clients { acl-internal; };
allow-query { acl-internal; };
recursion yes;
};
view "external" {
match-clients { any; };
recursion no;
};

18
source/named.conf Normal file
View File

@@ -0,0 +1,18 @@
options {
listen-on { any; };
directory "/bind/etc";
recursion no;
allow-notify { none; };
forwarders { 208.67.220.220; 208.67.222.222; };
version "0.0";
auth-nxdomain no;
max-cache-size 256m;
};
acl acl-internal {
10.0.0.0/8;
172.16.0.0/12;
192.168.0.0/16;
};
include "zones.conf";

10
source/zones.conf Normal file
View File

@@ -0,0 +1,10 @@
view "internal" {
match-clients { acl-internal; };
allow-query { acl-internal; };
recursion yes;
};
view "external" {
match-clients { any; };
recursion no;
};