mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #199] resolv.conf keeps getting overwritten by another process #80
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ctrlbrk42 on GitHub (May 25, 2020).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/199
Running GCP VM
My /etc/resolv.conf keeps getting overwritten. I suspect its due to DHCP lease renewal from GCP.
The Docker container doesn't detect this, and leaves the resolv.conf broken (no name resolution to containers from the host).
Could you consider monitoring resolv.conf for changes and then reverting them back to the proper config? Would be nice in my type of case.
@royduin commented on GitHub (Jun 25, 2020):
Copy the content of
/etc/resolv.confand then remove it with:sudo rm /etc/resolv.conf, next recreate the file with Nano or Vim:vi /etc/resolv.confand paste the content. Then restart the container.@mageddo commented on GitHub (Jul 9, 2020):
@ctrlbrk42 Acutally DPS watches for resolv.conf changes, DPS updates it every 20 seconds by default, you can check this by enabling debug log level. Two things can be happening here:
/etc/resolv.confis not volumed to the docker container/etc/resolv.confdocker is losing the reference and the file volume stop working, this is a known issueYou can easily fix it by following the solution at this issue or reading the getting started instructions
@mageddo commented on GitHub (Jul 9, 2020):
Please let me know if it works
@m1cx commented on GitHub (Jul 10, 2020):
On Ubuntu 20.04, with the Docker command given in "Getting started" in case of periodical overwrite, I get:
I have been using Mageddo DNS both as Docker service (standard command) and as a native service - both stop resolving after some time.
@unclesamwk commented on GitHub (Jul 17, 2020):
+1
@oeuftete commented on GitHub (Aug 22, 2020):
@m1cx To use the instructions at http://mageddo.github.io/dns-proxy-server/latest/en/1-getting-started/running-it/#on-docker for when
resolv.confstops getting updated, I had to create my own Dockerfile:Something like the following looks appealing, but the
VOLUME ["/var/run/docker.sock", "/var/run/docker.sock"]in the original prevents this; the resulting image ends up with a created/var/run/docker.sockdirectory which blocks the mount you need to run.I believe the changes in #195, among other things, would make this easier to do locally.
Hope this helps.
@m1cx commented on GitHub (Aug 28, 2020):
@oeuftete I tried to apply your suggestion, but ended up with exactly the same error while running it. Are your instructions complete?
I'm also not sure I understand the second part of your post. Is it finally possible to mount whole
/etcinto container so recreatedresolv.confis picked up, or not - with your solution?@cpedrero commented on GitHub (Jan 11, 2022):
Thanks @royduin I removed resolv.conf and it works!
@mageddo commented on GitHub (Mar 19, 2023):
1=> In the current version
3.14.xDPS supports systemd-resolved which can be one of the responsibles to cause this issue, in that case is better to use it, see the how to.2=> Run DPS with
-v /etc/:/host/etccan also fix the issue where resolv.conf stop of being updated,MG_RESOLVCONFenv is now looking at the following paths:/host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf3=> DPS actually also updates resolv.conf every 20 seconds
@mageddo commented on GitHub (Mar 19, 2023):
I think that's enough to consider this as fixed, right?