mirror of
				https://github.com/11notes/docker-bind.git
				synced 2025-11-03 21:33:14 +00:00 
			
		
		
		
	first version
This commit is contained in:
		
							
								
								
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
# ------ Header ------ #
 | 
			
		||||
FROM alpine:latest
 | 
			
		||||
 | 
			
		||||
#   // add bind
 | 
			
		||||
RUN apk update \
 | 
			
		||||
    && apk add --update bash \
 | 
			
		||||
    && apk add --no-cache bind
 | 
			
		||||
 | 
			
		||||
#   // create directory for zone configuration files
 | 
			
		||||
RUN mkdir -p /var/zones \
 | 
			
		||||
#   // delete default files
 | 
			
		||||
    && rm -R /etc/bind/*
 | 
			
		||||
 | 
			
		||||
#   // add default bind config for internal, external view + recursion
 | 
			
		||||
ADD ./named.conf /etc/bind/named.conf
 | 
			
		||||
 | 
			
		||||
# ------ define volumes ------ #
 | 
			
		||||
VOLUME ["/etc/bind", "/var/zones"]
 | 
			
		||||
 | 
			
		||||
# ------ entrypoint for container ------ #
 | 
			
		||||
CMD ["/usr/sbin/named", "-fg", "-c", "/etc/bind/named.conf"]
 | 
			
		||||
							
								
								
									
										25
									
								
								named.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								named.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
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;
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user