DNS search domain support in wg-quick

Matt Layher mdlayher at gmail.com
Thu Sep 26 20:55:48 CEST 2019


I probably should have tried this sooner, but yep, the PostUp works by 
stealing what wg-quick is doing with resolvconf, and if you also also 
set DNS nameservers in the same statement:

PostUp = echo -e "nameserver 192.168.1.1 fd00::1\nsearch lan.example.com 
lan.ipv4.example.com lan.ipv6.example.com" | resolvconf -a tun.%i -m 0 -x

- Matt

On 2019-09-26 2:40 p.m., Matt Layher wrote:
> I would like to add DNS search domain support to wg-quick and I have a 
> working patch for Linux. It would look something like:
>
> [Interface]
> Address = fe80::2/128
> PrivateKey = (redacted)
> DNS = 192.168.1.1, fd00::1
> DNSSearch = lan.example.com, lan.ipv4.example.com, lan.ipv6.example.com
>
> I have a few questions to ask:
>
> 1) Is this something that we would like to have upstream? It appears 
> it can also be done manually with a PostUp directive, but this also 
> seems to wipe out the configuration set by the DNS key under the 
> Interface section.
>
> 2) What is the policy for adding features like this across multiple 
> platforms? It should be straightforward to port the change from Linux 
> to FreeBSD and OpenBSD, but I'm unsure about Darwin and Android. 
> Darwin appears to have a networksetup flag to do the trick, but the 
> Android C changes would require much more scrutiny.
>
> Thanks for your time,
> Matt
>


More information about the WireGuard mailing list