Skip to content

[FEAT] How to not set DNS at all, a.k.a. PEERDNS=none? #382

Open
@pmorch

Description

@pmorch

Is this a new feature request?

  • I have searched the existing issues

Wanted change

I'd like a way to configure docker-wireguard, so the config files it creates don't set DNS at all.

Reason for change

I want remote access to my home lab and there are only two IP addresses in there - I don't want to change the client's DNS configuration (which is already complicated).

Proposed code change

I think I achieved this with this diff to the template in the config:

diff -u config/templates/peer.conf.orig  config/templates/peer.conf
--- config/templates/peer.conf.orig	2025-03-08 00:34:14.941119201 +0100
+++ config/templates/peer.conf	2025-03-07 23:36:30.654444001 +0100
@@ -3,7 +3,7 @@
 Address = ${CLIENT_IP}
 PrivateKey = $(cat /config/${PEER_ID}/privatekey-${PEER_ID})
 ListenPort = 51820
-DNS = ${PEERDNS}
+# DNS = ${PEERDNS}
 
 [Peer]
 PublicKey = $(cat /config/server/publickey-server)

(Or I could've just removed the line entirely).

It seems to work. Could it be documented? If we don't want to bother, feel free to just close this issue. I think I would've found it by searching for issues like this one 🙂.

Ideally this could be acheived with PEERDNS=none, but I couldn't see how that could easily be achieved with root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    • Status

      Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions