From 6dd7a7d80aaf79da8962c4285e0cfac659427f39 Mon Sep 17 00:00:00 2001 From: kev Date: Thu, 14 Apr 2016 01:36:03 +0800 Subject: [PATCH] add dnsmasq --- dnsmasq/Dockerfile | 18 ++++++++++++++++++ dnsmasq/README.md | 2 ++ dnsmasq/dnsmasq.d/README | 4 ++++ dnsmasq/dnsmasq.d/ads.conf | 1 + dnsmasq/dnsmasq.d/hosts.conf | 1 + dnsmasq/dnsmasq.d/nxdomains.conf | 2 ++ dnsmasq/dnsmasq.d/settings.conf | 4 ++++ dnsmasq/docker-compose.yml | 0 8 files changed, 32 insertions(+) create mode 100644 dnsmasq/Dockerfile create mode 100644 dnsmasq/README.md create mode 100644 dnsmasq/dnsmasq.d/README create mode 100644 dnsmasq/dnsmasq.d/ads.conf create mode 100644 dnsmasq/dnsmasq.d/hosts.conf create mode 100644 dnsmasq/dnsmasq.d/nxdomains.conf create mode 100644 dnsmasq/dnsmasq.d/settings.conf create mode 100644 dnsmasq/docker-compose.yml diff --git a/dnsmasq/Dockerfile b/dnsmasq/Dockerfile new file mode 100644 index 0000000..a3af5c2 --- /dev/null +++ b/dnsmasq/Dockerfile @@ -0,0 +1,18 @@ +# +# Dockerfile for dnsmasq +# + +FROM alpine +MAINTAINER kev + +RUN set -xe \ + && apk add -U dnsmasq \ + && echo "conf-dir=/etc/dnsmasq.d/,*.conf" >> /etc/dnsmasq.conf \ + && mkdir -p /etc/dnsmasq.d \ + && rm -rf /var/cache/apk/* + +VOLUME /etc/dnsmasq.d + +EXPOSE 53/tcp 53/udp 67/udp + +ENTRYPOINT ["/usr/sbin/dnsmasq", "--user=dnsmasq", "--group=dnsmasq"] diff --git a/dnsmasq/README.md b/dnsmasq/README.md new file mode 100644 index 0000000..8a9f650 --- /dev/null +++ b/dnsmasq/README.md @@ -0,0 +1,2 @@ +dnsmasq +======= diff --git a/dnsmasq/dnsmasq.d/README b/dnsmasq/dnsmasq.d/README new file mode 100644 index 0000000..aa2788b --- /dev/null +++ b/dnsmasq/dnsmasq.d/README @@ -0,0 +1,4 @@ +# All files in this directory which end in .conf +# will be read by dnsmasq as configuration files +# +# This can be changed by editing /etc/dnsmasq.conf diff --git a/dnsmasq/dnsmasq.d/ads.conf b/dnsmasq/dnsmasq.d/ads.conf new file mode 100644 index 0000000..1b23585 --- /dev/null +++ b/dnsmasq/dnsmasq.d/ads.conf @@ -0,0 +1 @@ +# server=/duobao999.com/ diff --git a/dnsmasq/dnsmasq.d/hosts.conf b/dnsmasq/dnsmasq.d/hosts.conf new file mode 100644 index 0000000..86068b2 --- /dev/null +++ b/dnsmasq/dnsmasq.d/hosts.conf @@ -0,0 +1 @@ +# host-record=google,8.8.8.8 diff --git a/dnsmasq/dnsmasq.d/nxdomains.conf b/dnsmasq/dnsmasq.d/nxdomains.conf new file mode 100644 index 0000000..66c3cfa --- /dev/null +++ b/dnsmasq/dnsmasq.d/nxdomains.conf @@ -0,0 +1,2 @@ +# bogus-nxdomain=202.102.110.203 +# bogus-nxdomain=202.102.110.204 diff --git a/dnsmasq/dnsmasq.d/settings.conf b/dnsmasq/dnsmasq.d/settings.conf new file mode 100644 index 0000000..73ae3b1 --- /dev/null +++ b/dnsmasq/dnsmasq.d/settings.conf @@ -0,0 +1,4 @@ +# no-hosts +# no-resolv +# cache-size=10000 +# server=127.0.0.1#2053 diff --git a/dnsmasq/docker-compose.yml b/dnsmasq/docker-compose.yml new file mode 100644 index 0000000..e69de29