Parcourir la source

working example included.

Tomi Cvetic il y a 6 ans
Parent
commit
d2375d15fd
6 fichiers modifiés avec 72 ajouts et 41 suppressions
  1. 6 4
      Dockerfile
  2. 28 0
      named.conf
  3. 11 0
      zones/fender.reverse.zone
  4. 11 0
      zones/fnog.reverse.zone
  5. 0 18
      zones/named.conf
  6. 16 19
      zones/slurm.ch.zone

+ 6 - 4
Dockerfile

@@ -1,10 +1,12 @@
 FROM alpine:latest
 
-RUN apk add --no-cache bind
+MAINTAINER Tomi Cvetic <tomi@slurm.ch>
 
-EXPOSE 53/tcp 53/udp
+RUN apk add --no-cache --update bind
 
-VOLUME ["/etc/bind", "/var/lib/bind"]
+EXPOSE 53:53/udp
 
-CMD ["/usr/sbin/named", "-f", "-g"]
+VOLUME ["/etc/bind/named.conf", "/etc/bind/zones"]
+
+CMD ["/usr/sbin/named", "-g", "-u", "named"]
 

+ 28 - 0
named.conf

@@ -0,0 +1,28 @@
+options {
+	directory "/var/bind";
+
+	listen-on { any; };
+	listen-on-v6 { any; };
+
+	allow-query { any; };
+	allow-transfer { none; };
+	allow-update { none; };
+	allow-recursion { none; };
+
+	recursion no;
+};
+
+zone "slurm.ch" IN {
+	type master;
+	file "/etc/bind/zones/slurm.ch.zone";
+};
+
+zone "145.168.214.91.in-addr.arpa" {
+	type master;
+	file "/etc/bind/zones/fender.reverse.zone";
+};
+
+zone "104.92.33.178.in-addr.arpa" {
+	type master;
+	file "/etc/bind/zones/fnog.reverse.zone";
+};

+ 11 - 0
zones/fender.reverse.zone

@@ -0,0 +1,11 @@
+$TTL 1D
+@		IN	SOA	ns2.slurm.ch.	mail.slurm.ch. (
+			2018072001	; Serial
+			8h		; Refresh
+			2h		; Retry
+			4w		; Expire
+			2d )		; TTL Negative Cache
+
+@		IN	NS	ns2.slurm.ch.
+
+91.214.168.145	IN	PTR	mail

+ 11 - 0
zones/fnog.reverse.zone

@@ -0,0 +1,11 @@
+$TTL 1D
+@				IN	SOA	ns3.slurm.ch.	mail.slurm.ch. (
+			2018072001	; Serial
+			8h		; Refresh
+			2h		; Retry
+			4w		; Expire
+			2d )		; TTL Negative Cache
+
+@				IN	NS	ns3.slurm.ch.
+
+104.92.33.178.in-addr.arpa.	IN	PTR	fnog

+ 0 - 18
zones/named.conf

@@ -1,18 +0,0 @@
-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 "slurm.ch" IN {
-	type master;
-	file "slurm.ch.zone";
-}

+ 16 - 19
zones/slurm.ch.zone

@@ -1,22 +1,19 @@
 $TTL 1d
 @ IN SOA ns1.slurm.ch. root.slurm.ch. (
-        2016010101      ; serial
-        28800           ; refresh (8 hours)
-        7200            ; retry (2 hours)
-        2419200         ; expire (4 weeks)
-        86400           ; minimum (1 day)
+        2018072001      ; serial
+        1d	        ; refresh (8 hours)
+        6h              ; retry (2 hours)
+        4w              ; expire (4 weeks)
+        1d              ; minimum (1 day)
 )
-                NS      ns1.slurm.ch.
-                NS      ns2.slurm.ch.
-                NS      ns3.slurm.ch.
-ns1             IN      A               1.2.3.4
-ns2             IN      A               1.2.3.4
-ns3             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"
+                NS      ns1
+                NS      ns2
+                NS      ns3
+@               IN      MX      10      mail
+@               IN      A               185.11.138.86
+ns1             IN      A               185.11.138.86
+ns2             IN      A               91.214.168.145
+ns3             IN      A               178.33.92.104
+mail            IN      A               91.214.168.145
+www             IN      CNAME   	ns1
+*		IN	CNAME		www