⚠️ No Official Image: There is no official MaraDNS Docker image. You must build your own from source.
This guide shows how to build a MaraDNS container from source.
For Docker installation, see Docker.
mkdir -p /opt/maradns
cd /opt/maradns
Create a Dockerfile to build MaraDNS from source:
FROM alpine:latest
LABEL maintainer="Your Name"
LABEL description="MaraDNS DNS Server"
ARG MARADNS_VERSION=3.5.0036
ARG DOWNLOAD_URL=https://maradns.samiam.org/download/3.5
RUN apk add --no-cache \
gcc \
make \
musl-dev \
wget \
&& wget ${DOWNLOAD_URL}/maradns-${MARADNS_VERSION}.tar.xz \
&& tar -xJf maradns-${MARADNS_VERSION}.tar.xz \
&& cd maradns-${MARADNS_VERSION} \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -rf maradns-${MARADNS_VERSION} maradns-${MARADNS_VERSION}.tar.xz \
&& apk del gcc make musl-dev wget
# Create config directory
RUN mkdir -p /etc/maradns
EXPOSE 53/udp 53/tcp
CMD ["maradns", "-f", "/etc/maradns/mararc"]
Create docker-compose.yml:
services:
maradns:
build: .
container_name: maradns
ports:
- "53:53/udp"
- "53:53/tcp"
volumes:
- ./config:/etc/maradns
restart: unless-stopped
cap_add:
- NET_BIND_SERVICE
Create config/mararc:
# MaraDNS minimal configuration
ipv4_bind_addresses = "0.0.0.0"
chroot_dir = "/etc/maradns"
csv2 = {}
csv2["example.com."] = "db.example.com"
Create a zone file config/db.example.com:
example.com. 10.1.2.3
www.example.com. 10.1.2.3
# Build the image
docker compose build
# Start the container
docker compose up -d
# Check logs
docker compose logs -f maradns
NET_BIND_SERVICE capability or running as rootmararc and zone files via volumeNeed Docker help? Our team provides consulting for:
Contact us or email office@linux-server-admin.com.