mirror of
https://github.com/11notes/docker-bind.git
synced 2025-11-21 14:58:44 +00:00
switch to OpenDNS
This commit is contained in:
35
Dockerfile
35
Dockerfile
@@ -1,21 +1,24 @@
|
|||||||
# ------ Header ------ #
|
# :: Header
|
||||||
FROM alpine:latest
|
FROM alpine:3.9
|
||||||
|
|
||||||
# // add bind
|
# :: Run
|
||||||
RUN apk update \
|
USER root
|
||||||
&& apk add --update bash \
|
|
||||||
&& apk add --no-cache bind
|
|
||||||
|
|
||||||
# // create directory for zone configuration files
|
RUN mkdir -p /bind/etc \
|
||||||
RUN mkdir -p /var/zones \
|
&& mkdir -p /bind/var
|
||||||
# // delete default files
|
|
||||||
&& rm -R /etc/bind/*
|
|
||||||
|
|
||||||
# // add default bind config for internal, external view + recursion
|
RUN apk --update --no-cache add \
|
||||||
ADD ./named.conf /etc/bind/named.conf
|
bash \
|
||||||
|
bind
|
||||||
|
|
||||||
# ------ define volumes ------ #
|
RUN rm -R /etc/bind
|
||||||
VOLUME ["/etc/bind", "/var/zones"]
|
|
||||||
|
|
||||||
# ------ entrypoint for container ------ #
|
ADD ./source/named.conf /bind/etc/named.conf
|
||||||
CMD ["/usr/sbin/named", "-fg", "-c", "/etc/bind/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"]
|
||||||
25
named.conf
25
named.conf
@@ -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
18
source/named.conf
Normal 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
10
source/zones.conf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
view "internal" {
|
||||||
|
match-clients { acl-internal; };
|
||||||
|
allow-query { acl-internal; };
|
||||||
|
recursion yes;
|
||||||
|
};
|
||||||
|
|
||||||
|
view "external" {
|
||||||
|
match-clients { any; };
|
||||||
|
recursion no;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user