diff --git a/Dockerfile b/Dockerfile index 6462aa5..c2f7f62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.4 -MAINTAINER Leonid Makarov +MAINTAINER Leonid Makarov RUN apk add --no-cache \ curl \ @@ -23,9 +23,9 @@ COPY conf/dnsmasq.tmpl /etc/dnsmasq.d/dockergen.tmpl COPY conf/supervisord.conf /etc/supervisor.d/docker-gen.ini COPY entrypoint.sh /opt/entrypoint.sh -# Default IP for Drude -ENV DNS_IP '192.168.10.10' -ENV DNS_ZONE 'localzone' +# Default domain and IP for wildcard query resolution +ENV DNS_DOMAIN 'docksal' +ENV DNS_IP '192.168.64.100' ENV LOG_QUERIES false EXPOSE 53/udp diff --git a/entrypoint.sh b/entrypoint.sh index e64c521..809f793 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,12 +3,12 @@ set -e # Default command (assuming container start) if [ "$1" = 'supervisord' ]; then - # $DNS_ZONE IP config for dnsmasq - touch /etc/dnsmasq.d/${DNS_ZONE}.conf - # Resolve *.$DNS_ZONE to $DNS_IP - echo "address=/${DNS_ZONE}/${DNS_IP}" >> /etc/dnsmasq.d/${DNS_ZONE}.conf - # Reverse resolution of $DNS_IP to ${DNS_ZONE} - echo $DNS_IP | awk -v dzone=${DNS_ZONE} -F . '{print "ptr-record="$4"."$3"."$2"."$1".in-addr.arpa,"dzone}' >> /etc/dnsmasq.d/${DNS_ZONE}.conf + # $DNS_DOMAIN IP config for dnsmasq + touch /etc/dnsmasq.d/${DNS_DOMAIN}.conf + # Resolve *.$DNS_DOMAIN to $DNS_IP + echo "address=/${DNS_DOMAIN}/${IP}" >> /etc/dnsmasq.d/${DNS_DOMAIN}.conf + # Reverse resolution of $DNS_IP to ${DNS_DOMAIN} + echo $DNS_IP | awk -v dzone=${DNS_DOMAIN} -F . '{print "ptr-record="$4"."$3"."$2"."$1".in-addr.arpa,"dzone}' >> /etc/dnsmasq.d/${DNS_DOMAIN}.conf # Turn query loggin on if [ "$LOG_QUERIES" = true ]; then