The issue I am facing:
When updating gravity I get the following errors, as per the thread linked below:
[✗] DNS resolution is currently unavailable*
[✗] DNS resolution is not available*
As discussed here:
I have solved the issue temporarily using the steps in the thread above, but when I restart the Docker container I lose the changes that I made to /etc/resolv.conf. I gather that this is expected behaviour, but how do I make these changes permanent? Also, I am running a fresh install of the official PiHole Docker container, so why has this problem happened? I guess I must have got the config wrong somewhere...?
Details about my system:
Official PiHole image running in Docker with default settings.
What I have changed since installing Pi-hole:
Nothing, other than the changes to resolv.conf detailed in the linked thread.
I'd probably start by changing the Docker host systems DNS server settings.
You are not setting any specific DNS server for the container, so your hosts machine's DNS servers should propagate into your container automatically, i.e. your hosts DNS settings should be picked up upon container creation.
You could also try to add specific DNS servers by adding lines similar like the following to pihole:
dns:
- 127.0.0.1
- 1.1.1.1
Be aware though that this sporadically was causing issues in the past, where some Docker installations would refuse starting a container when 127.0.0.1 would not be the first in list, while others did so when it wasn't the last, and still others didn't complain either way.
Thank you for your quick reply. When you say "start by changing the Docker host system's DNS server settings" do you mean that I should set the Docker host to use the Pihole as its DNS server or will this create some sort of weird situation where the host won't have a DNS server until the Pihole container has finished booting?
With regards to changing the docker-compose file is my usage of PIHOLE_DNS_: '127.0.0.1;1.1.1.1' incorrect, then?
I obviously missed commenting on them - thank you for reminding me.
Those are Pi-hole's upstream DNS servers.
The localhost address 127.0.0.1 should be avoided there.
The same is probably true for your Docker host system's DNS servers, as localhost would mean differerent recipients on the host and inside a container, unless you were using Docker's host network mode.