g0Idfinger / docker-HTPC

Home Plex Server with Reverse Proxy
The Unlicense
14 stars 0 forks source link

PiHole was working now it is having DNS issues #3

Closed sudo-kraken closed 4 years ago

sudo-kraken commented 4 years ago

I had it up and running for a day or two then on a reboot the pihole container keeps erroring stating that the nameserver in /etc/resolv.conf is 127.0.0.11 which is wrong, I have tried to swap out the environment variables for this: dns:

Also on an unrelated note once I get this working again is there a way to get pihole to work with cloudflared for dnssec I noticed this was commented out in your yml file and was wondering if it is possible to do with treafik etc without defining ipv4 addresses as usually when I do that and restart my containers it says the address is already in use.

Apologies if this is the wrong forum.

g0Idfinger commented 4 years ago

In my resolv.conf, I have the actual LAN IP address of my server 'nameserver 192.168.1.10' as an example. can you try changing yours to that and see if that works?

I removed cloudeflared as it doesn't allow me to use to use DNS 1.0.0.2 for secure yet. 1.0.0.2 allows for filtering out known malware sites and is a cloudflare DNS server. It should work if you enable it. If not open it up under a new issue and I will resolve as I get time.

sudo-kraken commented 4 years ago

in your resolvconf are you refering to the one in the pihole container? if so you cant edit this ?. Would you be able to tell me how to get it working with pihole once I get pihole up or does the commented out config in your yml work ?

g0Idfinger commented 4 years ago

This is the resolve.conf on my host server. not in the pihole container.

sudo-kraken commented 4 years ago

the one in my host server is my router ip

sudo-kraken commented 4 years ago

so far I have run these commands sudo systemctl disable systemd-resolved.service sudo systemctl stop systemd-resolved.service sudo nano /etc/NetworkManager/NetworkManager.conf added dns=default sudo mv /etc/resolv.conf /etc/resolv.conf.bak sudo service network-manager restart The used the same setup as you in your compose file for pihole but without ip addresses as when I tried it with them when the container restarted it said the ips were in use everytime, but now a few days later pihole stopped working and started complaining about 127.0.0.11 which if you bash into the pihole container and check out /etc/resolv.conf it has nameserver = 127.0.0.11 and then wont start up.

sudo-kraken commented 4 years ago

I noticed that your yml for pihole had this

g0Idfinger commented 4 years ago

My pihole is working, with no issues with that config. I'm also using my pihole as my DHCP server so I can see the computer names in the pihole dashboard.

My pihole /etc/resolve.conf: nameserver 127.0.0.11 options ndots:0

g0Idfinger commented 4 years ago

Make sure you put your host IP address in your local /etc/resolv.conf this is the IP address of your Ubuntu server.

sudo-kraken commented 4 years ago

So in my host resolv.conf it should have my router up and host ip?

g0Idfinger commented 4 years ago

My host resolv.conf only has my host IP.

sudo-kraken commented 4 years ago

Did you run any of the above commands ?

sudo-kraken commented 4 years ago

Ive updated the resolv.conf to my server ip and rebooted with the same yml as you but pihole logs still show the dns service failed?

g0Idfinger commented 4 years ago

Let me see if I can lab this out and check the process.

sudo-kraken commented 4 years ago

Thank you so much

sudo-kraken commented 4 years ago

It also seems adding the network manager part above auto replaces the resolvconf to the router ip something to consider in the lab

sudo-kraken commented 4 years ago

Just to update I have ran the following and got it working again.

Commented out the dns=default in the NetworkManager conf file sudo apt-get remove --purge resolvconf && sudo apt-get install resolvconf This put my resolv.conf back in place, I then editted it to only contain my ip for my server, then stoped and disabled the systemd-resolved.service and edited my compose file to match yours but added in the below. dns: 127.0.0.1

once it came up it worked and then I rebooted for good measure, but on reboot it still works however the /etc/resolv.conf is now empty of any entries except for commented out ones which is odd, but it still seems to be working.

Not sure which part has got it working but I am unsure as to why its working, could just use some pointers from you to get the static ips working along with cloudflared for dnssec

g0Idfinger commented 4 years ago

Thanks for pointing out this issue to me and forcing me to lab out my project. I found tons of errors. It looks like I'm missing a few files for the DHCP portion to work properly and the log file directory was wrong. Once I fixed that it seams to start up. I'm not sure how my prod one is working. I will be updating files here shortly.

sudo-kraken commented 4 years ago

it also broke grafana, did you have this issue

sudo-kraken commented 4 years ago

and oauth is dead and hydra by the looks of it

g0Idfinger commented 4 years ago

@adradloff no problem, I also spotted in the readme youll need to update the docker exec switch to -ti :)

I'm not sure what you are saying here. can you elaborate?

g0Idfinger commented 4 years ago

I'm not using Grafana, so I don't know. Oauth is working just fine for me in my lab.

sudo-kraken commented 4 years ago

I’ve got it all working smoothly the only thing that breaks grafana is when I use cloudflared as well I think it breaks the dns for that container as it’s saying it can’t contact grafana.com to pull its dependencies