Browse Source

Clone from https://github.com/pstauffer/docker-bind

wadim 7 years ago
parent
commit
b25fd73a13
5 changed files with 88 additions and 1 deletions
  1. 9 0
      Dockerfile
  2. 24 1
      README.md
  3. 13 0
      example/docker-compose.yml
  4. 18 0
      example/named.conf
  5. 24 0
      example/zones/example.com.zone

+ 9 - 0
Dockerfile

@@ -0,0 +1,9 @@
+FROM alpine:latest
+
+RUN apk add --no-cache bind
+
+EXPOSE 53/tcp 53/udp
+
+VOLUME ["/etc/bind", "/var/lib/bind"]
+
+CMD ["/usr/sbin/named", "-f", "-g"]

+ 24 - 1
README.md

@@ -1,2 +1,25 @@
-# bind
+# BIND Container
 
+[BIND](http://bind9.net/) server running on [Alpine Linux](https://hub.docker.com/_/alpine/).
+
+## Configuration
+
+See [example directory](https://git.sdsys.ru/sdsys/bind/example) for sample config file.
+
+## Quickstart
+
+```yml
+bind:
+  image: joebiellik/bind
+
+  volumes:
+    # You must provide a config file
+    - ./named.conf:/etc/bind/named.conf
+
+    # Zone files
+    - ./zones:/var/lib/bind
+
+  ports:
+    - "53:53/tcp"
+    - "53:53/udp"
+```

+ 13 - 0
example/docker-compose.yml

@@ -0,0 +1,13 @@
+bind:
+  image: joebiellik/bind
+
+  volumes:
+    # You must provide a config file
+    - ./named.conf:/etc/bind/named.conf
+
+    # Zone files
+    - ./zones:/var/lib/bind
+
+  ports:
+    - "53:53/tcp"
+    - "53:53/udp"

+ 18 - 0
example/named.conf

@@ -0,0 +1,18 @@
+options {
+	directory "/var/lib/bind";
+
+	listen-on { any; };
+	listen-on-v6 { any; };
+
+	allow-query { any; };
+	allow-transfer { none; };
+	allow-update { none; };
+	allow-recursion { none; };
+
+	recursion no;
+};
+
+zone "example.com" IN {
+	type master;
+	file "example.com.zone";
+};

+ 24 - 0
example/zones/example.com.zone

@@ -0,0 +1,24 @@
+$TTL 1d
+@ IN SOA ns1.example.com. root.example.com. (
+        2016010101      ; serial
+        28800           ; refresh (8 hours)
+        7200            ; retry (2 hours)
+        2419200         ; expire (4 weeks)
+        86400           ; minimum (1 day)
+)
+                NS      ns1.example.com.
+                NS      ns2.example.net.
+                NS      ns3.example.org.
+                NS      ns4.example.com.
+ns1             IN      A               1.2.3.4
+ns2             IN      A               1.2.3.4
+ns3             IN      A               1.2.3.4
+ns4             IN      A               1.2.3.4
+@               IN      A               1.2.3.4
+www             IN      CNAME   @
+@               IN      MX      1       aspmx.l.google.com.
+@               IN      MX      5       alt1.aspmx.l.google.com.
+@               IN      MX      5       alt2.aspmx.l.google.com.
+@               IN      MX      10      aspmx2.googlemail.com.
+@               IN      MX      10      aspmx3.googlemail.com.
+@               IN      TXT             "v=spf1 mx a include:_spf.google.com ~all"