SOLUTION: Pi-Hole running in a container on QNAP Container Station
- oyvindo
- Experience counts
- Posts: 1399
- Joined: Tue May 19, 2009 2:08 am
- Location: Norway, Oslo
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Well, I guess that's the way Pi-Hole was designed. Mine is like that too. But I keep track of client IP<-->HOST mapping using Fing.
-
- Getting the hang of things
- Posts: 58
- Joined: Mon Aug 24, 2015 4:11 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Thanks for the writeup!
Unfortunately I have some issues while running the Pi-Hole setup:
Sometimes "Preparing to configure resolvconf (amd64)" hangs forever (around 46% I think).
Now it's stuck at "Configuring resolvconf (amd64)" at 79%.
I've tried deleting and recreating the LXC five times now. Always stuck at 79%.
The IP is reserved, and I changed MAC in the LXC each time to make sure it is correct.
Any idea what this could be?
Unfortunately I have some issues while running the Pi-Hole setup:
Sometimes "Preparing to configure resolvconf (amd64)" hangs forever (around 46% I think).
Now it's stuck at "Configuring resolvconf (amd64)" at 79%.
I've tried deleting and recreating the LXC five times now. Always stuck at 79%.
The IP is reserved, and I changed MAC in the LXC each time to make sure it is correct.
Any idea what this could be?
-
- Getting the hang of things
- Posts: 58
- Joined: Mon Aug 24, 2015 4:11 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Had to run "sudo apt install resolvconf" first and then I choose "Y" when there was an issue.
Pi-Hole installer could be run afterwards.
Any way to check which DNS's are being used for a query?
I've added Pi-Hole's addresses for primary IPv4 and IPv6 in my Google Wifi DNS setup, and set 1.1.1.1 and 2606:4700:4700::1111 as secondary (Cloudflare).
How can I test that everything is OK? I did immediately notice that my pages were ad-free, so it does work, just wanna make sure I have everything setup correctly.
Pi-Hole installer could be run afterwards.
Any way to check which DNS's are being used for a query?
I've added Pi-Hole's addresses for primary IPv4 and IPv6 in my Google Wifi DNS setup, and set 1.1.1.1 and 2606:4700:4700::1111 as secondary (Cloudflare).
How can I test that everything is OK? I did immediately notice that my pages were ad-free, so it does work, just wanna make sure I have everything setup correctly.
-
- Starting out
- Posts: 13
- Joined: Tue Nov 22, 2016 12:58 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
It has something to do with the virtualization of it because when I run pihole on an actual raspberry pi it shows the hostnames correctly. I just haven't been able to pin down what the issue is.
-
- Starting out
- Posts: 10
- Joined: Mon May 27, 2019 2:30 am
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Thank you for the helpful post
-
- New here
- Posts: 6
- Joined: Wed Oct 02, 2019 4:34 am
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Hi Jasonin951 - did you ever find a solution to the problem with internal name resolution using Pi Hole via a QNAP container (LXC) I've tried quite a few things, seems that if I SSH into the Pi Hole and run nslookup it fails to resolve internal names due to using nameservers of Google!!!jasonin951 wrote: ↑Sun Aug 18, 2019 12:35 amIt has something to do with the virtualization of it because when I run pihole on an actual raspberry pi it shows the hostnames correctly. I just haven't been able to pin down what the issue is.
This is my only fault with this setup, within DHCP on Pi Hole and all logs/reports just shows as 'unknown' or 'xxx.xxx.xxx.xxx' IP addess!!
-
- New here
- Posts: 6
- Joined: Wed Oct 02, 2019 4:34 am
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Well after deleting my LXC containers, re-installing several times I was still getting the error of not resolving local hostnames on the network. If I manually edited resolv.conf and removed the reference to 8.8.8.8 and 8.8.4.4 only leaving nameserver 127.0.0.1 the local name resolution worked. The network / Dashboard in PI Hole resolved as expected and showed local hostnames.
The problem was when the LXC Ubuntu Pi Hole was rebooted or restarted, whether by container or QNAP, this file would revert back to 8.8.8.8 and 8.8.4.4 and therefore break local DNS names in Pi Hole.
I found that removing the entries in /etc/resolvconf/resolv.conf.d/base (leaving it empty) and leaving only 127.0.0.1 in /etc/resolvconf/resolv.conf.d/head resovled the problem for me.
My setup is QNAP NAS, LXC Ubuntu Container, static IP in bridge mode. PI Hole is DHCP/DNS as I disabled this on my router - a sky SR102 which does not let you change DNS for it's built in DHCP.
This is now working, for me, as expected!! Hope it helps someone.
The problem was when the LXC Ubuntu Pi Hole was rebooted or restarted, whether by container or QNAP, this file would revert back to 8.8.8.8 and 8.8.4.4 and therefore break local DNS names in Pi Hole.
I found that removing the entries in /etc/resolvconf/resolv.conf.d/base (leaving it empty) and leaving only 127.0.0.1 in /etc/resolvconf/resolv.conf.d/head resovled the problem for me.
My setup is QNAP NAS, LXC Ubuntu Container, static IP in bridge mode. PI Hole is DHCP/DNS as I disabled this on my router - a sky SR102 which does not let you change DNS for it's built in DHCP.
This is now working, for me, as expected!! Hope it helps someone.
Last edited by Parksy81 on Sun Oct 13, 2019 7:19 am, edited 1 time in total.
- oyvindo
- Experience counts
- Posts: 1399
- Joined: Tue May 19, 2009 2:08 am
- Location: Norway, Oslo
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
@Parksy81, My resolve.conf contained only the following:
which is my LAN Default Gateway.
I tried to change it to nameserver 127.0.0.1 and then restart (reboot) Pi-Hole from the Web interface. But that made no difference! It still fails to resolve hostnames.
(Restaring Pi-Hole did not revert the setting. 127.0.0.0 is still the only setting in /etc/resolve.conf)
Any idea what I've done wrong?
Code: Select all
nameserver 192.168.0.1
I tried to change it to nameserver 127.0.0.1 and then restart (reboot) Pi-Hole from the Web interface. But that made no difference! It still fails to resolve hostnames.
(Restaring Pi-Hole did not revert the setting. 127.0.0.0 is still the only setting in /etc/resolve.conf)
Any idea what I've done wrong?
-
- First post
- Posts: 1
- Joined: Sat Sep 26, 2015 1:47 am
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
I have successfully set up the PiHole following the guide a the beginning of this thread. It was very helpful (only thought is to include what is happening with each of the commands with their arguments, but that is a minor suggestion). I am experiencing the same issue others have noted where local hostnames are not resolving - specifically the local host name of the container. I have tried editing the hosts file:
{this starts vim editor in super user mode
{this changes the mode from command to insert}
{this is the local hostname of the container (PiHole in my case)}
{ESC Key}
{this changes the vim editor back to command mode}
{Colon is the command key, w is write and q is quit}
I also tried adding my router ip to the /etc/resolv.conf file and reordering the lookup table. But when doing a nslookup for any internal machine I would still get an error.
Either:
or
Code: Select all
sudo vim /etc/hosts
Code: Select all
i
Code: Select all
127.0.0.1 PiHole
{ESC Key}
{this changes the vim editor back to command mode}
Code: Select all
:wq
I also tried adding my router ip to the /etc/resolv.conf file and reordering the lookup table. But when doing a nslookup for any internal machine I would still get an error.
Either:
Code: Select all
** server can't find {localmachinename}: NXDOMAIN
Code: Select all
Non-authoritative answer:
** can't find {localmachinename}: No Answer
-
- Starting out
- Posts: 13
- Joined: Tue Nov 22, 2016 12:58 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Thanks so much! I will have to try this tonight.Parksy81 wrote: ↑Thu Oct 03, 2019 5:25 am Well after deleting my LXC containers, re-installing several times I was still getting the error of not resolving local hostnames on the network. If I manually edited resolv.conf and removed the reference to 8.8.8.8 and 8.8.4.4 only leaving nameserver 127.0.0.1 the local name resolution worked. The network / Dashboard in PI Hole resolved as expected and showed local hostnames.
The problem was when the LXC Ubuntu Pi Hole was rebooted or restarted, whether by container or QNAP, this file would revert back to 8.8.8.8 and 8.8.4.4 and therefore break local DNS names in Pi Hole.
I found that removing the entries in /etc/resolvconf/resolv.conf.d/base (leaving it empty) and leaving only 127.0.0.1 in /etc/resolvconf/resolv.conf.d/head resovled the problem for me.
My setup is QNAP NAS, LXC Ubuntu Container, static IP in bridge mode. PI Hole is DHCP/DNS as I disabled this on my router - a sky SR102 which does not let you change DNS for it's built in DHCP.
This is now working, for me, as expected!! Hope it helps someone.
-
- New here
- Posts: 6
- Joined: Wed Oct 02, 2019 4:34 am
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Hey - I've recently had to rebuild due to changing network range, ran through my previous post to get me back working again! One thing I forgot to add was I also needed to re-generat the resolv.conf file by runningoyvindo wrote: ↑Sat Oct 05, 2019 4:00 pm @Parksy81, My resolve.conf contained only the following:which is my LAN Default Gateway.Code: Select all
nameserver 192.168.0.1
I tried to change it to nameserver 127.0.0.1 and then restart (reboot) Pi-Hole from the Web interface. But that made no difference! It still fails to resolve hostnames.
(Restaring Pi-Hole did not revert the setting. 127.0.0.0 is still the only setting in /etc/resolve.conf)
Any idea what I've done wrong?
sudo resolvconf -u
Thanks
- oyvindo
- Experience counts
- Posts: 1399
- Joined: Tue May 19, 2009 2:08 am
- Location: Norway, Oslo
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
@Parksy81
I tried to run :
But all I got was this:
So, now what?
I tried to run :
Code: Select all
sudo resolvconf -u
Code: Select all
sudo: unable to resolve host ubuntu-xenial-1
-
- First post
- Posts: 1
- Joined: Fri Jan 17, 2020 10:53 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
Hi, oyvindo,oyvindo wrote: ↑Fri Nov 08, 2019 6:09 am @Parksy81
I tried to run :But all I got was this:Code: Select all
sudo resolvconf -u
So, now what?Code: Select all
sudo: unable to resolve host ubuntu-xenial-1
i don't know if you have managed to solve the problem by yourself in these past few months, but i found that just restarting the system from the web panel, made the trick for me. Like you, i followed Parksy81 precious tips and when i tried to re-generate the resolv.conf file, it gave me the same error. So i tried to restart pi-hole system and the file was correctly generated. Now i can see my devices hostnames instead of ips.
-
- New here
- Posts: 8
- Joined: Fri Mar 29, 2019 7:40 pm
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
All pi-hole installations I saw is using a container.
My question is: Is it possible to install directly on QNAP OS ? Why use a container if you can install it into QNAP linux?
Did anyone tried it?
Thank you
My question is: Is it possible to install directly on QNAP OS ? Why use a container if you can install it into QNAP linux?
Did anyone tried it?
Thank you
- oyvindo
- Experience counts
- Posts: 1399
- Joined: Tue May 19, 2009 2:08 am
- Location: Norway, Oslo
Re: SOLUTION: Pi-Hole running in a container on QNAP Container Station
No, I made several restarts from the Dashboard. I even flushed the log and restarted the DNS, but still - all I have is IP'sEVOAXL wrote: ↑Fri Jan 17, 2020 11:13 pm Hi, oyvindo,
i don't know if you have managed to solve the problem by yourself in these past few months, but i found that just restarting the system from the web panel, made the trick for me. Like you, i followed Parksy81 precious tips and when i tried to re-generate the resolv.conf file, it gave me the same error. So i tried to restart pi-hole system and the file was correctly generated. Now i can see my devices hostnames instead of ips.
Are you running your's in a container?