[GH-ISSUE #321] Feature: systemd-resolved support #112

Closed
opened 2026-02-26 04:34:04 +03:00 by kerem · 1 comment
Owner

Originally created by @mageddo on GitHub (Feb 25, 2023).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/321

Based on request made at #248

🍏 1 => DPS will detect and configure systemd-resolved when available

By reading the same configuration property of resolv.conf (MG_RESOLVCONF env), if DPS has all the requirements needed to restart systemd-resolved service it will also restarts the service because it's required to the changes to take effect, if DPS can't do that then it will log as a warning that systemd-resolved files were changed and the command which the user must run to apply the changes (service systemd-resolved restart)

🍏 2 => MG_RESOLVCONF will now accept more than one value

They will separated by comma , DPS will look for each value, try to use it and stops when finds a valid value, some path which is able to configure (an existing path, with the right read and write permissions and parseable by DPS)

🍏 3 => The default value of MG_RESOLVCONF will changes to

/host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf

This way DPS can by default try to configure systemd-resolved on Linux then fallback to resolv.conf. The additional directory /host/etc will be useful when running in a docker container and people prefer to mount a entire directory.

🍏 4 => Update the docs

  • 🍏 Describe new values for MG_RESOLVCONF
  • 🍏 Change default running it on README.md
  • 🍏 Advise to prefer to use DPS without docker as it will automatically configure systemd-resolved
  • Update the "Set DPS as default DNS" docs: R: ?

5 => DPS will try workarounds to automatically restart system-resolved when running inside a container

Moved to #329

Originally created by @mageddo on GitHub (Feb 25, 2023). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/321 Based on request made at #248 ### :green_apple: 1 => DPS will detect and configure systemd-resolved when available By reading the same configuration property of resolv.conf (`MG_RESOLVCONF` env), if DPS has all the requirements needed to restart systemd-resolved service it will also restarts the service because it's required to the changes to take effect, if DPS can't do that then it will log as a warning that systemd-resolved files were changed and the command which the user must run to apply the changes (`service systemd-resolved restart`) * [Resolved file format reference][1] ### :green_apple: 2 => MG_RESOLVCONF will now accept more than one value They will separated by comma `,` DPS will look for each value, try to use it and stops when finds a valid value, some path which is able to configure (an existing path, with the right read and write permissions and parseable by DPS) ### :green_apple: 3 => The default value of MG_RESOLVCONF will changes to ``` /host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf ``` This way DPS can by default try to configure systemd-resolved on Linux then fallback to resolv.conf. The additional directory `/host/etc` will be useful when running in a docker container and people prefer to mount a entire directory. ### :green_apple: 4 => Update the docs * :green_apple: Describe new values for MG_RESOLVCONF * :green_apple: Change default running it on README.md * :green_apple: Advise to prefer to use DPS without docker as it will automatically configure systemd-resolved * Update the "Set DPS as default DNS" docs: R: ? ### :x: 5 => DPS will try workarounds to automatically restart system-resolved when running inside a container Moved to #329 [1]: https://www.freedesktop.org/software/systemd/man/resolved.conf.html
kerem 2026-02-26 04:34:04 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@mageddo commented on GitHub (Feb 26, 2023):

It's alive at 3.4. I'm using the following command:

$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/systemd/:/host/etc/systemd --network host \
defreitas/dns-proxy-server:3.4.0-beta
<!-- gh-comment-id:1445244234 --> @mageddo commented on GitHub (Feb 26, 2023): It's alive at 3.4. I'm using the following command: ```bash $ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ -v /etc/systemd/:/host/etc/systemd --network host \ defreitas/dns-proxy-server:3.4.0-beta ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#112
No description provided.