broke my bed now it's dead

Setup CoreDNS on Alpine Linux

Posted on

Now that we have a WireGuard VPN, let's add a DNS server, to type letters instead of numbers!

Install CoreDNS

You will need to enable the community repo first.

doas apk add coredns


Create the config in

# snippets
(common) {
    cache 60
    acl {
        allow net

# intranet
philt3r {
    import common
    log . {combined} {
        class denial error success

    hosts { intra.philt3r

# extranet
. {
    import common

    # Free DNS
    forward .

My DNS service of choice comes from Feel free to put your own favorite DNS service!

Script to launch on server startup

CoreDNS already has a service!

The logs of CoreDNS should be available at


Use CoreDNS on the system

Now that we have our DNS server, let's use it on our server!

If you use DHCP to get the ip address of your server, the DNS will always be used from the DHCP.

We want to use our own DHCP server.

Create the file (and the folder associated with it)


and put


Then, edit the


and put


Restart the server.