mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-26 01:45:59 +03:00
[GH-ISSUE #166] Possible running condition with resolvconf package ? #69
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#69
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 @rgudwin on GitHub (Oct 19, 2019).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/166
What is Happening
I installed dns-proxy-server using:
I use the -d to detach docker and run in background.
It works pretty well, but stops working in an intermittent way, returning later.
I have a container called sim.manager and at some times, if I try to ping it, it works:
But from time to time it doesn't work:
later on, it starts working again ! Without doing anything !
What is expected
I would expect it to work consistently all the time.
Steps to Reproduce
It is really difficult to reproduce, because at some times it works, and later on it doesn't. Then it starts working again, without anything special. I am wondering if it is in a running condition with the resolvconf package, which is installed in my machine, because if I look at the /etc/resolv.conf, I have the following warning:
I suspect that resolvconf is overwriting the file and from time to time it competes with dns-proxy-server and makes it stop working, until dns-proxy-server re-writes the /etc/resolv.conf and starts working again. At least this is my guess ! Any hint, besides just uninstalling resolvconf ?
Specs:
@RomanHargrave commented on GitHub (Oct 22, 2019):
resolvconf has pre- and post-hooks that allow applications to insert entries in the file when it is updated. Perhaps DPS should write those instead?
@mageddo commented on GitHub (Nov 3, 2019):
@rgudwin
/etc/resolv.confcan be replaced anytime by the network manager, or whatever software who think it is necessary, commonly it happens when you suspend your machine, restart the wifi, renew the DHCP address, something related to the network or network card change.To bypass it, DPS has a cron which time to time reconfigures
/etc/resolv.conf, actually it is running every 20 seconds, no way to parameterize at this time.For now what you can try is to
MG_RESOLVCONFenv to/etc/resolvconf/resolv.conf.d/baseor
/etc/resolvconf/resolv.conf.d/head(if one of their exists)/etc/resolv.conffile for edition after you start DPS by runningsudo chattr +i /etc/resolv.conf@mrubli commented on GitHub (Dec 8, 2019):
This is likely caused by whatever process normally updates your
/etc/resolv.confusing the "safe" editing method of creating the new file under a different name first, then renaming the old file, and finally renaming the new file to the final name. This doesn't work well with Docker's file bind mounts as you can see here: https://github.com/moby/moby/issues/15793#issuecomment-135411504In my case that's what
dhclientwas doing and it rendered DPS's 20-second "watchdog" useless.The solution is pretty simple: Use a directory bind mount instead and point
MG_RESOLVCONFto the right path. For example, instead of bind-mounting the host's/etc/resolv.confto/etc/resolv.confin the container I bind-mount the host's/etcdirectory to/host/etcin the container and setMG_RESOLVCONF=/host/etc/resolv.conf.@mageddo It would be great if you could update the documentation to warn about this scenario and add a note on workarounds.
(For everyone trying to debug this kind of scenario, Linux auditing is of great help here. This answer on Server Fault summarizes it well.)
@mageddo commented on GitHub (Jan 3, 2020):
@mrubli awesome explanation. I think it is a good workaround, maybe better than the actual main solution. If you have time left to make this contribution about the resolv.conf on the docs please.
I'll do that not sure when, btw :-/
@mageddo commented on GitHub (Jul 9, 2020):
To make it easier to find in the future, the docs are here