DNS resolution is currently unavailable every time I reboot debian server

I've encountered this issue 3 times now, and it always happens after I reboot my debin server that I have pihole on docker installed on. I've removed/deleted config folder, and reinstalled a fresh instance of pihole 3 times.

After every reboot, I can see in the logs it states,

WARNING Misconfigured DNS in /etc/resolv.conf: Two DNS servers are recommended, 127.0.0.1 and any backup server,
WARNING Misconfigured DNS in /etc/resolv.conf: Primary DNS should be 127.0.0.1 (found 127.0.0.11),

Here is the log file from portainer. http://pasted.co/447ab050

Please let me know if I'm missing something I should put in here, new and running a fever.

These warnings are here to avoid the bigger problem you see in the log:
[✗] DNS resolution is currently unavailable,

This will go away when you add --dns 127.0.0.1 --dns 1.1.1.1 to your docker run.

more detail at GitHub - pi-hole/docker-pi-hole: Pi-hole in a docker container

1 Like

I have dns 127.0.0.1 and dns 1.1.1.1 already set in my docker compose.

Here is my docker-compose file. http://pasted.co/08559a04

Reading up on github, I learned that 127.0.0.11 is docker's network so the issue I imagined was somewhere else.

I had a peak at my /etc/resolv.conf and when the nameserver is set to my debian server/pihole's address, it doesn't work.

# Generated by NetworkManager
nameserver 192.168.1.13'

however, when I set my nameserver to my router 192.168.1.1 The container seems to perfectly fine.

  - DNS1=127.0.0.1
  - DNS2=1.1.1.1

this is an environment variable, you're looking for the dns: [list] setting not environment: [list], the difference being DNS is for the container's resolv.conf wehre as the DNS env vars are for DNSMasq's upstream dns servers (e.g. dnsmasq service uses dns:, clients of dnsmasq will use the upstream servers from env)

check this example and use these 3 lines: https://github.com/pi-hole/docker-pi-hole/blob/master/docker-compose.yml#L25-L27

I should have payed closer attention to the two things.

Thanks for the explanation. Two questions.

  1. if I'm using
    dns:
    - 127.0.0.1
    - 1.1.1.1

Is it ok to leave the DNS env vars since they're for DNSMasq? Or am I likely to run into some issues? I don't foresee any issues but asking just incase.

  1. About to research this one, is there a way in pihole to exclude specific IP addresses from having any content blocked? My wife works from home and I don't want to mistakenly block something she needs to use for work. My guess is this is something I'd have to do on the router level instead of on the pihole.

Is it ok to leave the DNS env vars since they’re for DNSMasq

I wouldn't leave DNS1 ENV set to 127.0.0.1, it should have an external sever. It's circular pointing dnsmasq at localhost (it's self).

is there a way in pihole to exclude specific IP addresses from having any content blocked?

There are a couple ways to approach that, my first suggestion is just have her disable Pi-hole by programming her DNS static to an external server is probably the simplest. If you want her to have Pi-hole in the evening when not working then use the web interface disable during her work hours. You could also try whitelsting her work's domain(s) with a wildcard or regex.