unifi-utilities / unifios-utilities

A collection of enhancements for UnifiOS based devices
GNU General Public License v3.0
3.9k stars 419 forks source link

Gone after UDMP reboot #21

Closed hfagelnour closed 4 years ago

hfagelnour commented 4 years ago

pihole didn't start after reboot and when i try to reinstall i get this " podman run -d --network dns --restart always \

--name pihole \
-e TZ="America/Los Angeles" \
-v "/mnt/data/etc-pihole/:/etc/pihole/" \
-v "/mnt/data/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
--dns=127.0.0.1 --dns=1.1.1.1 \
--hostname pi.hole \
-e VIRTUAL_HOST="pi.hole" \
-e PROXY_LOCATION="pi.hole" \
-e ServerIP="10.0.5.3" \
-e IPv6="False" \
pihole/pihole:latest

Error: error creating container storage: the container name "pihole" is already in use by "32093b8493a045dff4044bd6ae45d5b45062edd69f18a6cd07767ebd28bfe92f". You have to remove that container to be able to reuse that name.: that name is already in use"

SamErde commented 4 years ago

Did you complete the steps for the onboot script and add one to automatically start pihole at startup? https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script

hfagelnour commented 4 years ago

Did you complete the steps for the onboot script and add one to automatically start pihole at startup? https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script

yes podman start pihole

boostchicken commented 4 years ago

@hfagelnour you should never have to run the "podman run" command again. It already exists. Your on boot script should just be podman start pihole. Also, podman start pihole from the command should just work. What error is it giving?

boostchicken commented 4 years ago

@hfagelnour also make sure you update 10-dns.sh. You need to give it the container name pihole

https://github.com/boostchicken/udm-utilities/blob/49e3dccf1420b9fc7753d7f99d3ab5af370f4c8d/dns-common/on_boot.d/10-dns.sh#L27-L28

Change nextdns to pihole.

Also, you will not need a custom on_boot.d script if you use the 10-dns.sh

SamErde commented 4 years ago

@hfagelnour also make sure you update 10-dns.sh. You need to give it the container name pihole

https://github.com/boostchicken/udm-utilities/blob/49e3dccf1420b9fc7753d7f99d3ab5af370f4c8d/dns-common/on_boot.d/10-dns.sh#L27-L28

Change nextdns to pihole.

Yeah, that's gotta be it.

Also, you will not need a custom on_boot.d script if you use the 10-dns.sh

Ha, I forgot that was baked into this script. Nice.

hfagelnour commented 4 years ago

@hfagelnour also make sure you update 10-dns.sh. You need to give it the container name pihole https://github.com/boostchicken/udm-utilities/blob/49e3dccf1420b9fc7753d7f99d3ab5af370f4c8d/dns-common/on_boot.d/10-dns.sh#L27-L28

Change nextdns to pihole.

Yeah, that's gotta be it.

Also, you will not need a custom on_boot.d script if you use the 10-dns.sh

Ha, I forgot that was baked into this script. Nice.

@SturdyErde @boostchicken thx so much for the help, creating the custom on_boot.d script fixed it. now my next problem is probably a UDMP controller setting. all DNS queries are registered on the pihole as being requested by only one IP (10.0.5.1) although it is resolving for the whole network. i used (10.0.5.3) as the DNS for the local networks in the controller network settings. which setting do i need to change?

SamErde commented 4 years ago

Change the DNS server setting on your WAN network to the IP address of your Pihole. This is how it will be used for name resolution of outgoing DNS queries.

hfagelnour commented 4 years ago

Correct but all queries appear as it is coming from the gateway all together instead of per client on the network.

Sent from my iPhone

On Jul 20, 2020, at 3:57 PM, SturdyErde notifications@github.com wrote:

 Change the DNS server seeing on your WAN network to the IP address of your Pihole. This is how it will be used for name resolution of outgoing DNS queries.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

SamErde commented 4 years ago

That probably means your DHCP settings are telling each client to use the router/gateway as their DNS server. Check your DHCP options for a DNS and point them to the IP address of your pihole.

hfagelnour commented 4 years ago

not really ..... all clients point to the UDMPihole as their DNS server as u mentioned ... this is probably a wrong setting in the UDM it self. will look into it and come back to you. i cant thank you enough for the help

boostchicken commented 4 years ago

@hfagelnour get the latest 10-dns.sh. It fixes that problem.

hfagelnour commented 4 years ago

It did, thx so much

Sent from my iPhone

On Jul 21, 2020, at 4:13 AM, John D. notifications@github.com wrote:

 @hfagelnour get the latest 10-dns.sh. It fixes that problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.