sslip.io: run DNS server in Docker container

- Include BIND secondaries for nono.io/nono.com
  (use this & you'll be unwitting secondaries for my domains)
- Fedora-based. Because IBM/Red Hat hires a lot of the Linux kernel developers.
This commit is contained in:
Brian Cunnie
2020-04-29 17:28:36 -07:00
parent d79128ae37
commit 23456d6a20
3 changed files with 56 additions and 0 deletions

42
k8s/Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
# sslip.io Dockerfile
#
# Dockerfile of a DNS server that responds to DNS
# queries of hostnames with embedded IP addresses
# (e.g. "169.254.169.254.example.com") with the IP
# address ("169.254.169.254). See https://sslip.io
# for more information
#
# Typical start command:
#
# docker run --rm -p 53:53 -p 53:53/udp cunnie/sslip.io
#
# To test from host:
#
# dig +short 127.0.0.1.example.com @localhost
# 127.0.0.1
#
FROM fedora AS sslip.io
LABEL maintainer="brian.cunnie@gmail.com"
RUN dnf install -y pdns pdns-backend-pipe
RUN dnf install -y iproute bind-utils neovim
RUN curl -o /usr/local/sbin/pdns_pipe.sh -L https://raw.githubusercontent.com/cunnie/bin/master/pdns_pipe.sh
RUN chmod 755 /usr/local/sbin/pdns_pipe.sh
COPY pdns.conf /etc/pdns/pdns.conf
COPY named.conf /etc/pdns/named.conf
ENTRYPOINT ["/usr/sbin/pdns_server", "--guardian=no", "--daemon=no", "--disable-syslog", "--log-timestamp=no", "--write-pid=no"]
# for testing:
# ENTRYPOINT /usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no
# DNS listens on port 53 UDP, but sometimes connects via TCP (AXFR).
# The `EXPOSE` directive doesn't do much in our case. We use it for documentation.
EXPOSE 53/udp
EXPOSE 53/tcp

10
k8s/named.conf Normal file
View File

@@ -0,0 +1,10 @@
zone "nono.com" {
type slave;
file "/etc/pdns/nono.com";
masters { 78.46.204.247; };
};
zone "nono.io" {
type slave;
file "/etc/pdns/nono.io";
masters { 78.46.204.247; };
};

4
k8s/pdns.conf Normal file
View File

@@ -0,0 +1,4 @@
launch=bind,pipe
slave=yes
bind-config=/etc/pdns/named.conf
pipe-command=/usr/local/sbin/pdns_pipe.sh