Skip to content

Update nsswitch.conf to use systemd-resolved#10

Merged
pothos merged 3 commits intoflatcar:flatcar-masterfrom
f0o:issue-285-nsswitch
Jan 4, 2021
Merged

Update nsswitch.conf to use systemd-resolved#10
pothos merged 3 commits intoflatcar:flatcar-masterfrom
f0o:issue-285-nsswitch

Conversation

@f0o
Copy link
Contributor

@f0o f0o commented Dec 4, 2020

Update nsswitch.conf to use systemd-resolved

Partly related to flatcar/Flatcar#285 as suggested by @pothos
This allows nsswitch to use systemd-resolved

How to use

Update the nsswitch.conf ;)

Testing done

#/etc/systemd/resolved.conf:

[Resolve]
DNS=10.0.0.2
Domains=~example.internal
# ping web.example.internal
PING web.example.internal (10.0.154.231) 56(84) bytes of data.
...
# ping google.com
PING google.com (172.217.21.142) 56(84) bytes of data.
...

This test shows that systemd's split-horizon (routed-domains) is working and nsswitch is also using systemd-resolved instead of /etc/resolv.conf (the DNS referenced is NOT recursive)

HOWEVER

it's important to note that anything using /etc/resolv.conf will fail to use systemd-resolved until the stublistener is re-enabled and the symlink it set to /run/systemd/resolve/stub-resolv.conf as outlined in the linked issue. (This limitation does not impose any regression as it didnt work before at all, so this is now a half-working solution - full working is achieved by removing /lib/systemd/resolved.conf.d/50-no-dns-listener.conf and replacing /etc/resolv.conf)

Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
pothos added a commit that referenced this pull request Dec 7, 2020
Update nsswitch.conf to use systemd-resolved
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
@pothos pothos merged commit abbf6b6 into flatcar:flatcar-master Jan 4, 2021
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments