All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>, Joe Doss <joe@solidadmin.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Fixing wg-quick's DNS= directive with a hatchet
Date: Fri, 27 Oct 2017 18:06:50 -0400	[thread overview]
Message-ID: <87she4fdol.fsf@fifthhorseman.net> (raw)
In-Reply-To: <CAHmME9pn977yhsu-rVdR-Mz+ZnsrUaxjQYxc2SveYL9zKNXB4w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3392 bytes --]

On Fri 2017-10-27 19:15:08 +0200, Jason A. Donenfeld wrote:
> (Daniel and Egbert seem mostly okay with the butchered resolvconf in
> their distros; at least they don't see any reason to change things,
> since it mostly works, and users there at least have the choice of
> somehow installing openresolv need be.)

fwiw, i'm *not* ok with resolvconf.  I tried to help co-maintain it for
several years and stepped back from it in disappointment.  I don't even
remember the details at this point, but I'm not convinced that it's
particularly architecturally sound.  I haven't looked at openresolv
myself.

I personally think that the hatchet is an unfortunate distraction from
wireguard.  If Jason decides to ship it upstream, i'll include it in the
debian packages as part of his decision.  However, i suspect it will
break some people's DNS resolution in ways that they don't know how to
recover from besides a reboot (maybe it'll come back after a reboot too?
yikes).  I suspect this will raise even worse noise and abuse than
"Rodney"'s silliness.  And this time, they'll be (at least partly)
right, because the experimental networking tool that they installed will
have done bizarre things to their filesystem mount points(!) and
hijacked an important system configuration file out from under whatever
was maintaining it in the first place.

------

So I think wireguard is better off with a light touch here.  If Jason
just wants to maintain the current openresolv hook, then any wg-quick
invocation that tries to set DNS can just warn on non-openresolv
systems.  something liike:

    you asked me to set up the DNS but i only know how to do that with
    openresolv installed.  Please install openresolv and try again!

This isn't as magic as the hatchet, but it means wireguard is not
responsible for breaking the user's name resolution.

And if folks want to integrate it with other /etc/resolv.conf managers,
they can write, test, and propose patches themselves.

-----

As for what the right solution looks like on a modern GNU/Linux system:

A sensible approach (which i think should be the default on machines
running systemd) is to use systemd-resolved as a local resolving cache.
The easiest way to do that permanently is:

    systemctl enable --now systemd-resolved
    ln -sf /lib/systemd/resolv.conf /etc/resolv.conf

If your networking is configured by systemd-networkd, then everything
else JustWorks™


On systems that use network-manager, you should tell nm to just inform
resolved when it learns about new DNS servers:

    cat > /etc/NetworkManager/conf.d/use-resolved.conf <<EOF
    [main]
    dns=systemd-resolved
    EOF
    systemctl restart NetworkManager

On a system configured with systemd-resolved (with or without
network-manager), i'd want wg-quick to just inform systemd-resolved that
it has a new DNS resolver available.  This is probably some ungodly dbus
invocation that i don't know what it is, but would likely not be an
impossibility to figure out.

    https://www.freedesktop.org/wiki/Software/systemd/resolved/

If someone has the fortitude to wade through that, i'd happily ship such
a patch in debian (and encourage Jason to take it upstream alongside his
openresolv hook), but i'm scattered to too many places to do that myself
today.

all the best,

       --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2017-10-27 22:24 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 22:43 Fixing wg-quick's DNS= directive with a hatchet Jason A. Donenfeld
2017-10-25 23:37 ` Kalin KOZHUHAROV
2017-10-26  0:55   ` Jason A. Donenfeld
2017-10-26  1:32 ` [PATCH] wg-quick: use bind mount for DNS when no openresolv Jason A. Donenfeld
2017-10-26  1:53   ` Kalin KOZHUHAROV
2017-10-26  1:54     ` Jason A. Donenfeld
2017-10-26 13:41   ` [PATCH v2] " Jason A. Donenfeld
2017-10-26  2:54 ` Fixing wg-quick's DNS= directive with a hatchet Eric Light
2017-10-26  3:21   ` Jason A. Donenfeld
2017-10-26 13:11 ` Jason A. Donenfeld
2017-10-26 16:56 ` Joe Doss
2017-10-26 17:24   ` Jason A. Donenfeld
2017-10-26 21:22   ` Jason A. Donenfeld
2017-10-27 10:07     ` Martin Hauke
2017-10-27 13:22       ` Jason A. Donenfeld
2017-10-27 14:47     ` Joe Doss
2017-10-27 14:51       ` Jason A. Donenfeld
2017-10-27 15:02         ` Jason A. Donenfeld
2017-10-27 15:38           ` Joe Doss
2017-10-27 22:04           ` Bruno Wolff III
2017-10-27 15:38         ` Joe Doss
2017-10-27 17:15           ` Jason A. Donenfeld
2017-10-27 17:52             ` Jason A. Donenfeld
2017-10-27 22:06             ` Daniel Kahn Gillmor [this message]
2017-10-28  2:24               ` Jason A. Donenfeld
2017-10-28  2:39                 ` Jason A. Donenfeld
2017-10-28 14:35                 ` Daniel Kahn Gillmor
2017-10-28 17:57                   ` Jason A. Donenfeld
2017-10-29 12:21                     ` Geo Kozey
2017-10-29 17:07                       ` Jason A. Donenfeld
2017-10-30 11:58                       ` Daniel Kahn Gillmor
2017-10-30 12:10                     ` Daniel Kahn Gillmor
2017-10-29 22:06                   ` Jason A. Donenfeld
2017-10-30 12:16                     ` Daniel Kahn Gillmor
2017-10-31 10:49 ` Jason A. Donenfeld
2017-10-26 19:58 Geo Kozey
2017-10-26 21:11 ` Jason A. Donenfeld
2017-10-26 22:01   ` Geo Kozey
2017-10-26 22:19     ` Jason A. Donenfeld
2017-10-26 22:52       ` Geo Kozey

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=87she4fdol.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=Jason@zx2c4.com \
    --cc=joe@solidadmin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.