Pihole + LXC Problem

MisterY

Renowned Member
Oct 10, 2016
141
4
83
38
Hi, I'm running Proxmox and made a LXC and installed Pi-Hole in it. It is running fine, but I can't use it as a DNS-Server. Every other machine like Windows 8 says "dns not reachable" when I set it in the IPv4 settings manually. I set every firewall policy to accept on this LXC and I even disabled it, but nothing. I get all the time "dig google.de @192.168.0.150 ; <<>> DiG 9.9.5-9+deb8u13-Debian <<>> google.de @192.168.0.150 ;; global options: +cmd ;; connection timed out; no servers could be reached"

running it on 127.0.0.1 on the LXC itself, it works like a charm. Does anyone knows how to solve this problem?

I got only one NIC, but that shouldn't be a problem.

Pihole2.PNG Pihole3.PNG pihole4.PNG
 
does it work if you use the ip address inside the container (so not 127.0.0.1) ?
if not, maybe it is configured to only listen on localhost?
 
it doesn't work with the ip within the container. It is configured to listen on everything. I personally know one of the pihole team and he told me that it doesn't seem to be a problem with pihole, instead it has to be a problem with firewall and/or apparmor.
 
update: within a VM it works like a charm.

edit: wrong. I changed the dns of my router to the VM and I can't access anything...
 
Last edited:
Just tried installing pihole on an LXC here and hit the same blocker. Apparently, port 53 is already bound in the LXC:
Code:
May 11 17:09:11 pi-hole systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
May 11 17:09:11 pi-hole dnsmasq[88]: dnsmasq: syntax check OK.
May 11 17:09:12 pi-hole dnsmasq[113]: dnsmasq: failed to create listening socket for port 53: Address already in use
May 11 17:09:12 pi-hole dnsmasq[113]: failed to create listening socket for port 53: Address already in use
May 11 17:09:12 pi-hole systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
May 11 17:09:12 pi-hole dnsmasq[113]: FAILED to start up
May 11 17:09:12 pi-hole systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
I never had a problem running BIND in an OpenVZ container, but I think this is the first time I've tried running a resolver in an LXC.
 
Found some threads about dnsmasq-base being installed ahead of dnsmasq and creating this sort of conflict, from which came a helpful lsof query, which seems to indicate that systemd-resolve is shimming something:
Code:
root@pi-hole:~# lsof -Pn +M | grep ':53 (LISTEN)'
systemd-r  74     systemd-resolve   13u     IPv4            5632374      0t0        TCP 127.0.0.53:53 (LISTEN)