Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Alex Burke <>
Subject: Re: Split DNS for macOS
Date: Wed, 3 Nov 2021 22:46:11 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Andrew,

> What makes Wireguard so good is that it does one thing and does it really, really well.

I am in complete agreement on this, but Wireguard wouldn't really be "doing" (implementing) what Stephen and Matty are trying to accomplish, but rather simply integrating with the mechanism the Apple platform has implemented for doing precisely that.

While I'm not in a position to weigh in on how much development work it would entail for Jason et al to implement to the high standard Wireguard is known for, or how much bloat it would add, it's undoubtedly a killer feature, and it's my professional opinion that a significant proportion of the Wireguard user base would benefit from supporting it — especially for corporate use.

> On 3 Nov 2021 at 21:34, Andrew Fried <> wrote:
> Hi Matty,
> I understand exactly what you're trying to accomplish and agree that split dns can be challenging, especially with multiple VPN gateways.
> My point is that what you're describing is a DNS issue, not a firewall/vpn/routing issue.  As such, I think there's more eloquent way to solve DNS related issues.
> The old fashioned way is to add exceptions to the equivalent of the /etc/host file.  Not ideal, doesn't scale well and pretty static, but if you're relying on just a few private host mappings it works pretty well.
> The second and more palatable solution is to have the internal nameservers running software that supports views - such that queries for that originate from private address space return different answers than if the query originated from public space.
> A third option would be set the internal recursives up as forwarders that only respond authoritatively for your private "mydomain.internet" and forward all other requests to nameservers capable of public recursion.
> There's the dnsdist solution, which is an advanced dns proxy server capable of routing requests to different recursives based on the domain name.  DNSDIST does a lot of other stuff as well, but the heart of is intelligent proxying.  In our racks we use DNSDIST to distribute around a million DNS queries per minute and it works flawlessly.
> Basically, what I'm suggesting is that DNS servers handle DNS and wireguard handle routing/transport.  Adding VPN functionality to a nameserver or dns capabilities to Wireguard adds complexities that can be better handled elsewhere.
> What makes Wireguard so good is that it does one thing and does it really, really well.
> Andrew
> On 10/29/21 5:06 PM, Matty Driessen wrote:
>> Hello Andrew,
>> I just want to chime in here and say that I think the current
>> implementation of search domains is simply not working the way it
>> should on the MacOS client.
>> My use case is pretty common, an internal DNS server that has entries
>> for internal servers. I defined a search domain in the WireGuard
>> configuration; DNS = mydomain.internal. The search domain
>> is for convenience, so I can just use the servername instead of
>> servername.mydomain.internal. Now this works fine when I route all the
>> traffic through the VPN (AllowedIPs = but the search domain
>> is completely ignored when I only route the traffic I need to
>> (AllowedIPs =
>> I don't think this is a configuration error on my side. The DNS
>> responds fine when using servername.mydomain.internal. This problem is
>> even mentioned in the "WireGuard macOS & iOS TODO List"
>> 9. matchDomains=[“”] doesn’t do what the documentation says.
>> Specifically, DNS servers are not used if allowed IPs isn’t
>> The description isn't 100% accurate (or outdated), the DNS server is
>> used but the search domain isn't being set on the primary resolver.
>> Some have solved this issue by adding the search domains to the list
>> of matchDomains; dnsSettings.matchDomains = [""] +
>> dnsSettings.searchDomains. But that way the DNS server specified in
>> WireGuard is still the primary resolver for all DNS queries.
>> Here is a link on how OpenVPN handles this and I think it's how it
>> should work when not using AllowedIPs
>> On a split-tunnel, where redirect-gateway is not pushed by the server,
>> and at least one pushed DNS server is present:
>> - route all DNS requests through pushed DNS server(s) if no added
>> search domains.
>> - route DNS requests for added search domains only, if at least one
>> added search domain.
>> Yours sincerely,
>> Matty
>> --
>> Hi Stephen,
>> A better solution to your problem would be to deploy DNSDIST:
>> I for one would hope that esoteric requests that address a solution
>> for less than 1% of the users would be rejected with the overall goal
>> of preventing feature creep and bloat.
>> Andrew
> -- 
> Andrew Fried
> +1.703.667.4050 Office
> +1.703.362.0067 Mobile

  reply	other threads:[~2021-11-03 21:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 21:06 Matty Driessen
2021-11-03 21:34 ` Andrew Fried
2021-11-03 21:46   ` Alex Burke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-28  7:16 Stephen Larew
2021-10-28  9:58 ` Bruce Ferrell
2021-10-29 15:33   ` Stephen Larew
2021-10-29 17:03     ` Andrew Fried
2021-10-29 21:07       ` Stephen Larew
2021-10-30 21:00         ` Dusan Zivadinovic
2021-11-03  9:15         ` Harald Dunkel
2021-11-03  9:42           ` Matty Driessen
2021-11-03 11:54         ` Alex Burke
2021-11-06  4:54         ` David Anderson
2021-11-06  9:47           ` Matty Driessen
2022-01-28  5:23 ` Stephen Larew
2022-01-28  9:02   ` Harald Dunkel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).