Webux Lab

By Studio Webux

Coredns with Docker

TG
Tommy Gingras Studio Webux 2024-04-06

Setup coredns for local DNS within a container

Configuration

sudo mkdir /srv/coredns/

/srv/coredns/Corefile

.:53 {
    forward . 1.1.1.1 8.8.8.8
    log
    errors
}

webux.lab:53 {
    file /srv/coredns/webuxlab.db
    log
    errors
}

/srv/coredns/webuxlab.db

webux.lab.              IN  SOA dns.webux.lab. tommy.studiowebux.com. 2024040600 7200 3600 1209600 3600
gateway.webux.lab.      IN  A   192.168.1.1
dns.webux.lab.          IN  A   192.168.1.19
jenkins.webux.lab.      IN  A   192.168.1.19
git.webux.lab.          IN  A   192.168.1.19
file.webux.lab.         IN  A   192.168.1.19
metrics.webux.lab.      IN  A   192.168.1.19
logs.webux.lab.         IN  A   192.168.1.19
alerts.webux.lab.       IN  A   192.168.1.19
dashboard.webux.lab.    IN  A   192.168.1.19
nextcloud.webux.lab.    IN  A   192.168.1.19

Start container

docker run -d \
    --name coredns \
    --restart=always \
    --volume=/srv/coredns/:/srv/coredns/:ro \
    -p 53:53/udp \
    coredns/coredns -conf /srv/coredns/Corefile

Search