···7788---
991010-**Describe the bug**
1010+### Describe the bug
1111A clear and concise description of what the bug is.
12121313-**To Reproduce**
1313+### Steps To Reproduce
1414Steps to reproduce the behavior:
15151. ...
16162. ...
17173. ...
18181919-**Expected behavior**
1919+### Expected behavior
2020A clear and concise description of what you expected to happen.
21212222-**Screenshots**
2222+### Screenshots
2323If applicable, add screenshots to help explain your problem.
24242525-**Additional context**
2525+### Additional context
2626Add any other context about the problem here.
27272828-**Notify maintainers**
2828+### Notify maintainers
2929<!--
3030Please @ people who are in the `meta.maintainers` list of the offending package or module.
3131If in doubt, check `git blame` for whoever last touched something.
3232-->
33333434-**Metadata**
3434+### Metadata
3535Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
3636+3737+```console
3838+[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
3939+output here
4040+```
36413742Maintainer information:
3843```yaml
···617617 be removed in 22.05.
618618 </para>
619619 </listitem>
620620+ <listitem>
621621+ <para>
622622+ The order of NSS (host) modules has been brought in line with
623623+ upstream recommendations:
624624+ </para>
625625+ <itemizedlist spacing="compact">
626626+ <listitem>
627627+ <para>
628628+ The <literal>myhostname</literal> module is placed before
629629+ the <literal>resolve</literal> (optional) and
630630+ <literal>dns</literal> entries, but after
631631+ <literal>file</literal> (to allow overriding via
632632+ <literal>/etc/hosts</literal> /
633633+ <literal>networking.extraHosts</literal>, and prevent ISPs
634634+ with catchall-DNS resolvers from hijacking
635635+ <literal>.localhost</literal> domains)
636636+ </para>
637637+ </listitem>
638638+ <listitem>
639639+ <para>
640640+ The <literal>mymachines</literal> module, which provides
641641+ hostname resolution for local containers (registered with
642642+ <literal>systemd-machined</literal>) is placed to the
643643+ front, to make sure its mappings are preferred over other
644644+ resolvers.
645645+ </para>
646646+ </listitem>
647647+ <listitem>
648648+ <para>
649649+ If systemd-networkd is enabled, the
650650+ <literal>resolve</literal> module is placed before
651651+ <literal>files</literal> and
652652+ <literal>myhostname</literal>, as it provides the same
653653+ logic internally, with caching.
654654+ </para>
655655+ </listitem>
656656+ <listitem>
657657+ <para>
658658+ The <literal>mdns(_minimal)</literal> module has been
659659+ updated to the new priorities.
660660+ </para>
661661+ </listitem>
662662+ </itemizedlist>
663663+ <para>
664664+ If you use your own NSS host modules, make sure to update your
665665+ priorities according to these rules:
666666+ </para>
667667+ <itemizedlist spacing="compact">
668668+ <listitem>
669669+ <para>
670670+ NSS modules which should be queried before
671671+ <literal>resolved</literal> DNS resolution should use
672672+ mkBefore.
673673+ </para>
674674+ </listitem>
675675+ <listitem>
676676+ <para>
677677+ NSS modules which should be queried after
678678+ <literal>resolved</literal>, <literal>files</literal> and
679679+ <literal>myhostname</literal>, but before
680680+ <literal>dns</literal> should use the default priority
681681+ </para>
682682+ </listitem>
683683+ <listitem>
684684+ <para>
685685+ NSS modules which should come after <literal>dns</literal>
686686+ should use mkAfter.
687687+ </para>
688688+ </listitem>
689689+ </itemizedlist>
690690+ </listitem>
620691 </itemizedlist>
621692 </section>
622693</section>
+24
nixos/doc/manual/release-notes/rl-2111.section.md
···155155- The wordpress module provides a new interface which allows to use different webservers with the new option [`services.wordpress.webserver`](options.html#opt-services.wordpress.webserver). Currently `httpd` and `nginx` are supported. The definitions of wordpress sites should now be set in [`services.wordpress.sites`](options.html#opt-services.wordpress.sites).
156156157157 Sites definitions that use the old interface are automatically migrated in the new option. This backward compatibility will be removed in 22.05.
158158+159159+- The order of NSS (host) modules has been brought in line with upstream
160160+ recommendations:
161161+162162+ - The `myhostname` module is placed before the `resolve` (optional) and `dns`
163163+ entries, but after `file` (to allow overriding via `/etc/hosts` /
164164+ `networking.extraHosts`, and prevent ISPs with catchall-DNS resolvers from
165165+ hijacking `.localhost` domains)
166166+ - The `mymachines` module, which provides hostname resolution for local
167167+ containers (registered with `systemd-machined`) is placed to the front, to
168168+ make sure its mappings are preferred over other resolvers.
169169+ - If systemd-networkd is enabled, the `resolve` module is placed before
170170+ `files` and `myhostname`, as it provides the same logic internally, with
171171+ caching.
172172+ - The `mdns(_minimal)` module has been updated to the new priorities.
173173+174174+ If you use your own NSS host modules, make sure to update your priorities
175175+ according to these rules:
176176+177177+ - NSS modules which should be queried before `resolved` DNS resolution should
178178+ use mkBefore.
179179+ - NSS modules which should be queried after `resolved`, `files` and
180180+ `myhostname`, but before `dns` should use the default priority
181181+ - NSS modules which should come after `dns` should use mkAfter.
···99 hardware.sensor.iio = {
1010 enable = mkOption {
1111 description = ''
1212- Enable this option to support IIO sensors.
1212+ Enable this option to support IIO sensors with iio-sensor-proxy.
13131414 IIO sensors are used for orientation and ambient light
1515 sensors on some mobile devices.
···240240241241 system.nssModules = optional cfg.nssmdns pkgs.nssmdns;
242242 system.nssDatabases.hosts = optionals cfg.nssmdns (mkMerge [
243243- (mkOrder 900 [ "mdns_minimal [NOTFOUND=return]" ]) # must be before resolve
244244- (mkOrder 1501 [ "mdns" ]) # 1501 to ensure it's after dns
243243+ (mkBefore [ "mdns_minimal [NOTFOUND=return]" ]) # before resolve
244244+ (mkAfter [ "mdns" ]) # after dns
245245 ]);
246246247247 environment.systemPackages = [ pkgs.avahi ];
+2-1
nixos/modules/system/boot/resolved.nix
···140140141141 # add resolve to nss hosts database if enabled and nscd enabled
142142 # system.nssModules is configured in nixos/modules/system/boot/systemd.nix
143143- system.nssDatabases.hosts = optional config.services.nscd.enable "resolve [!UNAVAIL=return]";
143143+ # added with order 501 to allow modules to go before with mkBefore
144144+ system.nssDatabases.hosts = (mkOrder 501 ["resolve [!UNAVAIL=return]"]);
144145145146 systemd.additionalUpstreamSystemUnits = [
146147 "systemd-resolved.service"
+2-3
nixos/modules/system/boot/systemd.nix
···925925 system.nssModules = [ systemd.out ];
926926 system.nssDatabases = {
927927 hosts = (mkMerge [
928928- [ "mymachines" ]
929929- (mkOrder 1600 [ "myhostname" ] # 1600 to ensure it's always the last
930930- )
928928+ (mkOrder 400 ["mymachines"]) # 400 to ensure it comes before resolve (which is mkBefore'd)
929929+ (mkOrder 999 ["myhostname"]) # after files (which is 998), but before regular nss modules
931930 ]);
932931 passwd = (mkMerge [
933932 (mkAfter [ "systemd" ])