Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use systemd-resolved dbus interface instead of creating *.network files on-the-fly #13

Closed
piotr-dobrogost opened this issue Mar 25, 2016 · 7 comments

Comments

@piotr-dobrogost
Copy link

Currently, update-systemd-network.sh script creates .network files and restarts systemd-networkd. I asked on #systemd if this is the right way of doing this and got response from @grawity:

the proper way to make it work is to call org.freedesktop.resolve1.Manager.SetLinkDNS() via DBus

When using dbus there's no need to restart any service and create any files.
Docs for dbus API of resolved are at https://www.freedesktop.org/wiki/Software/systemd/resolved/

Compare RFE: please consider pushing DNS information into systemd-resolved

cc @WGH-

@WGH-
Copy link
Contributor

WGH- commented Mar 30, 2016

However, if systemd-networkd is restarted for any reason, it'll lose all the info. The solution with temporary .network files doesn't have this problem.

@piotr-dobrogost
Copy link
Author

I don't know systemd very well but I don't see how restarting one service (networkd) would make another service (resolved) loose any info.

@poettering
Copy link

The best option would be to push the DNS data directly into resolved, as mentioned.

Restarting networkd has no effect on resolved keeping the DNS data you pushed into it around or not. However, currently resolved will forget data you push into it if you restart resolved itself. That's certainly something we should fix though... I added that to my todo list now.

It would be fantastic if openvpn would push its discovered DNS data directly into resolved via the API we provide, and we have prepped documentation explaining how to do this:

https://wiki.freedesktop.org/www/Software/systemd/writing-network-configuration-managers/

Note that the interfaces have been added very recently only, hence you need 229 or newer to make this work.

@WGH-
Copy link
Contributor

WGH- commented Sep 29, 2016

Also, it seems that implemented solution is broken on newer systemd. Restarting systemd-networkd removes the IP from the VPN interface for some reason, leaving it without one.

@WGH-
Copy link
Contributor

WGH- commented Sep 29, 2016

https://github.com/jonathanio/update-systemd-resolved
This script seems to do the job. I don't really feel like rewriting what already works fine :)

@piotr-dobrogost
Copy link
Author

piotr-dobrogost commented Sep 30, 2016

Thanks for your engagement in this and the link!
Maybe update-systemd-network.sh script should be dropped then and information about https://github.com/jonathanio/update-systemd-resolved added to readme instead?

@WGH-
Copy link
Contributor

WGH- commented Oct 2, 2016

The script might remain useful for distributions stuck with older systemd versions, like Debian Jessie or Gentoo stable, though. So I'm against the complete removal.

But users running newer systemd should be redirected to the better script, I think.

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

No branches or pull requests

3 participants