Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Alexander Skwar <alexanders.mailinglists+nospam@gmail.com>
To: Shulhan <ms@kilabit.info>
Cc: Gijs Conijn <egc112@msn.com>, wireguard@lists.zx2c4.com
Subject: Re: WireGuard macOS App doesn't set system default DNS
Date: Thu, 6 Aug 2020 15:47:25 +0200	[thread overview]
Message-ID: <CADn-QaMR04GkUWY0=WV7-5epLcdWWx72+Sq1nkkKMFL48D5T8g@mail.gmail.com> (raw)
In-Reply-To: <01080173c3ec3af0-1dd63a48-4c02-42b8-b52b-0b0b65366ff9-000000@ap-southeast-2.amazonses.com>

Hello Shulhan

Am Do., 6. Aug. 2020 um 15:18 Uhr schrieb Shulhan <ms@kilabit.info>:
>
> > On 3 Aug 2020, at 19.14, Alexander Skwar <alexanders.mailinglists+nospam@gmail.com> wrote:
> >
> > Hello Erik,
> >
> > yes, I know that the DNS is private. This is why I have that on my macOS
> > configuration:
> >
> > # …
> > AllowedIPs = 10.136.16.0/22, 169.254.169.253/32
> > # …
> >
>
> Did you set DNS servers manually in "Advanced" section? If yes, try to clear it.

No, I haven't set DNS servers in the Advanced section.

> I use macOS too and everything works fine.

Hm. Using the script from https://github.com/myspaghetti/macos-virtualbox/
I created a macOS running in a VirtualBox as a VM. In this VM, I installed
WireGuard and imported my config. The issue could be reproduced.

To make it clear: nothing else, besides WireGuard and the bloat ware from
Apple was installed and the issue exists. This rules out that there is any
conflicting software installed or any bad configuration on my side. It just
leaves macOS and WireGuard.

On my normal (non-VM) system (where I have the same issues), I also
have OpenVPN and the system built-in VPN (IPsec) installed and configured
to use (not so on the VM). These tools are able to set the DNS. So this
also rules out that there's an issue with macOS.

FWIW, "wg-quick" (wireguard-tools) is able to set DNS (but fails to properly
revert, if multiple tunnels had been brought up at the same time - but that's
a different issue).

> Did the DNS server 10.136.16.2 is the same VM as WireGuard server?

No, it's not. And it's not limited to 10.136.16.2 as DNS server, WireGuard
also doesn't set it to e.g. 1.1.1.1 or 5.132.191.104 (OpenNIC). It only sets
it, when AllowedIPs=0.0.0.0/0.

My configuration (where WireGuard does NOT set DNS):

[Interface]
PrivateKey = ...=
Address = 172.31.0.3/24
DNS = 5.132.191.104

[Peer]
PublicKey = ...=
AllowedIPs = 10.136.16.0/22
Endpoint = wg.....ch:51820

That WireGuard does NOT set the DNS is also visible in the output of
the "dig" command. Eg.:

alex@Alexanders-MacBook-Pro ~ % dig ct.de

; <<>> DiG 9.10.6 <<>> ct.de
...
;; SERVER: 192.168.43.2#53(192.168.43.2)
...

(192.168.43.2 is the IP of my router; it shows that the default wasn't
changed.)

When I use AllowedIPs=0.0.0.0/0, the dig output has this line:

;; SERVER: 1.1.1.1#53(1.1.1.1)

Ie. 1.1.1.1 was used as the IP of system DNS.

Thanks again,

Alexander

      reply	other threads:[~2020-08-06 13:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03  9:15 Alexander Skwar
     [not found] ` <AM0PR07MB614721A4B6B17011C3DFF7C0964D0@AM0PR07MB6147.eurprd07.prod.outlook.com>
2020-08-03 12:14   ` Alexander Skwar
2020-08-06 13:18     ` Shulhan
2020-08-06 13:47       ` Alexander Skwar [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to='CADn-QaMR04GkUWY0=WV7-5epLcdWWx72+Sq1nkkKMFL48D5T8g@mail.gmail.com' \
    --to=alexanders.mailinglists+nospam@gmail.com \
    --cc=egc112@msn.com \
    --cc=ms@kilabit.info \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).