Commit Graph

20 Commits

Author SHA1 Message Date
Florian Klink
c1536f5c78 nixos/systemd: fix NSS database ordering
- The order of NSS (host) modules has been brought in line with upstream
  recommendations:

  - The `myhostname` module is placed before the `resolve` (optional) and `dns`
    entries, but after `file` (to allow overriding via `/etc/hosts` /
    `networking.extraHosts`, and prevent ISPs with catchall-DNS resolvers from
    hijacking `.localhost` domains)
  - The `mymachines` module, which provides hostname resolution for local
    containers (registered with `systemd-machined`) is placed to the front, to
    make sure its mappings are preferred over other resolvers.
  - If systemd-networkd is enabled, the `resolve` module is placed before
    `files` and `myhostname`, as it provides the same logic internally, with
    caching.
  - The `mdns(_minimal)` module has been updated to the new priorities.

  If you use your own NSS host modules, make sure to update your priorities
  according to these rules:

  - NSS modules which should be queried before `resolved` DNS resolution should
    use mkBefore.
  - NSS modules which should be queried after `resolved`, `files` and
    `myhostname`, but before `dns` should use the default priority
  - NSS modules which should come after `dns` should use mkAfter.
2021-07-17 23:55:35 +02:00
Konrad Borowski
66b2aaf2eb Revert "nixos/systemd: provide libidn2 for systemd-resolved"
This patch is no longer necessary with systemd v247.3.

This reverts commit c674a51382.
2021-04-12 18:37:18 +02:00
Florian Klink
c674a51382 nixos/systemd: provide libidn2 for systemd-resolved
systemd started using dlopen() for some of their "optional"
dependencies.

Apparently, `libidn2` isn't so optional, and systemd-resolved doesn't
work without libidn2 present, breaking DNS resolution.

Fixes https://github.com/NixOS/nixpkgs/issues/107537

Upstream bug: https://github.com/systemd/systemd/issues/18078
2020-12-25 13:45:25 +01:00
Peter Hoeg
13ed0cce2f nixos/systemd-resolved: fix incorrect user 2020-11-05 22:41:39 +08:00
Arian van Putten
0e18e5db99 nixos/resolved: Include dbus alias of resolved unit
This will make dbus socket activation for it work

When `systemd-resolved` is restarted; this would lead to unavailability
of DNS lookups.  You're supposed to use DBUS socket activation to buffer
resolved requests; such that restarts happen without downtime
2020-06-13 12:23:45 +02:00
Florian Klink
8325e0db11 Revert "nixos/resolved: Include dbus alias of resolved unit"
This reverts commit 7fe539f799.
2020-05-09 20:05:01 +02:00
Arian van Putten
7fe539f799 nixos/resolved: Include dbus alias of resolved unit
This will make dbus socket activation for it work

When `systemd-resolved` is restarted; this would lead to unavailability
of DNS lookups.  You're supposed to use DBUS socket activation to buffer
resolved requests; such that restarts happen without downtime
2020-05-08 14:21:25 +02:00
Florian Klink
7426bec45e nixos/systemd/resolved: add resolve to nss hosts database if enabled
We keep the "only add the nss module if nscd is enabled" logic for now.

The assertion never was triggered, so it can be removed.
2020-05-05 15:59:30 +02:00
WilliButz
2ffb2c0bd1
nixos/resolved: add user systemd-resolve to group systemd-resolve 2019-11-25 10:46:28 +01:00
Nikolay Amiantov
01b90dce78 resolvconf service: init
This is a refactor of how resolvconf is managed on NixOS. We split it
into a separate service which is enabled internally depending on whether
we want /etc/resolv.conf to be managed by it. Various services now take
advantage of those configuration options.

We also now use systemd instead of activation scripts to update
resolv.conf.

NetworkManager now uses the right option for rc-manager DNS
automatically, so the configuration option shouldn't be exposed.
2019-07-15 20:25:39 +03:00
Eelco Dolstra
de9e238469
FIx some malformed XML in option descriptions
E.g. these were using "<para>" at the *end* of a description. The real
WTF is that this is possible at all...
2019-05-13 09:15:17 +02:00
volth
2e979e8ceb [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
Benjamin Staffin
dca7e24a11
networkmanager: Expand dns description, integrate with other services (#41898)
Rather than special-casing the dns options in networkmanager.nix, use
the module system to let unbound and systemd-resolved contribute to
the newtorkmanager config.
2018-06-29 13:41:46 -04:00
Franz Pletz
eb862c48dd
systemd: 234 -> 237
Co-Authored-By: Florian Klink <flokli@flokli.de>
Co-Authored-By: Andreas Rammhold <andreas@rammhold.de>
2018-02-13 01:24:24 +01:00
Robert Helgesson
c4088dd0af
nixos/resolved: clean up option descriptions
Also change LLMNR RFC to the correct id 4795.
2017-10-17 10:11:19 +02:00
Robin Gloster
a38f1911d3
systemd: 231 -> 232
Includes adding some more upstream units and removing obsolete (-.slice) ones.
2017-01-26 17:52:52 +01:00
Alexander Ried
a31e07fc11 modules.resolved: Enhance by upstream options (#15897) 2016-06-26 22:58:04 +02:00
Eelco Dolstra
6bd4e0b8cd Create systemd-{network,resolve} user/group unconditionally
This shuts up this error from dbus:

May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file

which happens because the D-Bus config for networkd/resolved is
enabled unconditionally, and we don't have an easy way to turn it off.

(cherry picked from commit f19b58fb6a)
2015-07-22 12:23:45 +02:00
Eelco Dolstra
c87977e97d Don't include networkd units unless enabled
Otherwise, the enabled -> disabled transition won't be handled
correctly (switch-to-configuration currently assumes that if a unit is
running and exists, it should be restarted).
2015-04-19 22:06:45 +02:00
Eelco Dolstra
f8dbe5f376 systemd: Move networkd into separate modules
The systemd module was getting rather bloated.
2015-04-19 22:06:45 +02:00