Container for pDNSd - Self-hosted Caching DNS.
- locally cache DNS records,
- serve local hostnames from
- blocking ADs or malicious sites via hosts lists.
Built from my alpine-s6 image using the last released pDNSd.
Based on Alpine Linux.
The image is tagged respectively for the following architectures,
If the following files don't exits, the container downloads the hosts lists from
/data/hosts/. These are enabled in the default
configuration, and can be a little too restrictive for some.
Update the host files themselves or drop your own configuration at
/data/pdnsd.conf to get around it.
Another hacky way is to
sed through the hosts replacing the site
you want to unblock. e.g let's say we want to unblock RT News,
(assuming it gets blocked on some versions from hpHosts). So after
getting a shell into the container, run,
sed -i \ -e 's/\([ .]\)rt.com/\1notrt.com/g' \ /data/hosts/*
Get the Image
Pull the image for your architecture it's already available from
# make pull docker pull arpanpal010/alpine-pdnsd:armhf
On many systemd derivations e.g. ArchLinux, 53/udp may be already taken by systemd-resolved. In
that case, it will need to be stopped first before dns server is
sudo systemctl stop systed-resolved
# make docker run --rm -it \ --name docker_pdnsd --hostname pdnsd \ -e PGID=100 -e PUID=1001 \ -c 256 -m 256m \ -p 53/tcp -p 53/udp \ -v $(CURDIR)/data:/data \ -v /etc/hosts:/etc/hosts:ro \ -v /etc/localtime:/etc/localtime:ro \ -e TZ=Asia/Kolkata \ arpanpal010/alpine-pdnsd:armhf # make stop docker stop -t 2 docker_pdnsd # make rm # stop first docker rm -f docker_pdnsd # make restart docker restart docker_pdnsd
# make rshell docker exec -u root -it docker_pdnsd /bin/bash # make shell docker exec -it docker_pdnsd /bin/bash # make logs docker logs -f docker_pdnsd
PS: this bit is for dev only as you need the files from the repo.
# make systemd # add systemd.service as a service if it exists, load it, and start or restart # it if already running. # make updatehosts # update hosts file lists from the sources
If you have the repository access, you can clone and
build the image yourself for your own system, and can push after.
git clone <repository url> cd <repository>
You can always skip installing make but you will have to
type the whole docker commands then instead of using the sweet
To locally build the image for your system.
# make build docker build --rm --force-rm \ -t arpanpal010/alpine-pdnsd:armhf \ --no-cache=true --pull . # make push docker push arpanpal010/alpine-pdnsd:armhf
Currently built daily on a RaspberryPi3 (armhf builds) or IntelNUC
(x64 builds). Docker hub builds maintained by arpanpal010.