-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Chosen upstream DNS servers not saved #604
Comments
It's not very clear in the documentation, but you need to set it as an environment variable. Default is set to google on container creation. Change the environment to the servers you would like to use before creating the container. Example:
|
It would save if you've mounted persistent storage to /etc/pihole when launching the container. Also any customizations to the dnsmasq configs in /etc/dnsmasq.d would require a persistent volume to persist settings beyond a container relaunch. |
I found that even with persistant storage I had to set the environment variable, otherwise it would reset this specific part. All other changes would remain on container relaunch
|
I found out, that configuring DNS servers in addition to the two default Google DNS servers does work. But as soon as you remove the two Google ones, it defaults back to only two Google DNS. |
Happens to me as well.
|
Did you try putting your desired DNS as |
@cryptoluks That works. However it's only a workaround and no final solution. |
That’s a workaround I guess, not a solution. Why do I have to put it there if I have a config file available with DNS servers already set up?:)
… On 25 May 2020, at 10:11, cryptoluks ***@***.***> wrote:
Happens to me as well.
I had my cloudflare dns replaced by google already twice (in 01-pihole.conf).
My docker-compose.yml file:
version: '3'
services:
pihole:
...
volumes:
- '/opt/pihole/etc-pihole/:/etc/pihole/'
- '/opt/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/'
dns:
- 127.0.0.1
- 1.1.1.1
Did you try putting your desired DNS as ENVIRONMENT variables in docker-compose.yml? See here <#604 (comment)>. For me this works fine.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#604 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALM2S6GZFGOUDVMPCCWJNDRTIKZBANCNFSM4MRPOL6Q>.
|
the thing is the dnsmasq config file is overwritten at container start since the following function in
@diginc could you provide some information? |
after endless digging I think I found the root cause:
so the function |
Have you tried building the container off of the "dev" branch? #608 has been merged recently and may correct the problem. |
No I didn't but judging by the changes, this "only" fixes the issue for configurations done in setupVars.conf. Personally I have more interest in modifying dnsmasq options which cannot be set in setupVars (especially Like a mentioned in a previous post the function |
Hey devs, this should be fixed. All the config files should be persistent. Updating docker image should not change my config files. |
Does it not if you mount it as a volume? I have my entire |
tested it few time with mounted volume, every time the container is created it executes "touch" command and rewrites it. |
Spoke to soon, yes I can see this now. I guess I've just never paid any close attention to it That said, I have the |
Personally using docker "run" and not "compose" which makes it even more complex coz i can't pass ENV of dns with port numbers, so my only options is to set it to 127.0.0.1 or not include DNS ENV at all, in both cases it will rewrite my config to google's dns. Since i would like to run at least 3 containers (for real there are 18 at the same host right now): pihole, cloudflared, and watchtower for autoupdate of the containers the overwrites of config files prevent me from doing this. |
Test pihole/pihole:dev like @ahuffman mentioned please. I wrote a test Sunday for this and it seemed setting custom DNS settings after startup + restarting preserved the DNS settings. This is a bash test not the usual python so it should be easier to run/reproduce issues. Worked on dev but let me know if I missed some element of how to reproduce the problem. https://github.com/pi-hole/docker-pi-hole/pull/631/files#diff-c2cb325b583f5a066d29f58edb4f51e3 |
Hey adam!
To reproduce the issue:
|
Hey diginc, we still have problem with the commands:
|
any news? |
I am experiencing this issue as well... it is extremely annoying behaviour. :) Basically when doing a docker-compose down, followed by an up, the setupVars.conf file is overwritten. All values are preserved except for DNS1 and DNS2... so DNS3 and DNS4 are left alone. It would be nice if the content of setupVars.conf would be left alone during restart / recreation.... |
To add on to this, if only |
Closed in place of the pinned #720 |
In raising this issue, I confirm the following:
How familiar are you with the the source code relevant to this issue?:
1
Expected behaviour:
1: Change the Upstream DNS on the
/admin/settings.php?tab=dns
page. When docker was restarted or recreated (with persistent volume mounted) the chosen Upstream Servers in the list (left side) were not saved and back at Google DNS. I switched them several times to Cloudflare, saved. After a restart of container it was back at Google.Actual behaviour:
Selection not saved.
Troubleshooting undertaken, and/or other relevant information:
Tried several Docker container restarts and recreated. Did not work. I fixed it now by setting the CloudFlare DNS IPs as a custom DNS server on the right side.
The text was updated successfully, but these errors were encountered: