Pi-Hole on VM Debian Jessie - no internet connection

Hello all

first I am new to this, and long time not used Linux at all, so please excuse, if I lack some essentials.

I have Pi-Hole running on a virtual Debian running on my NAS

Setup was made with my Router IP as the only upstream DNS Server (tried others before as well)

Common problem arising is always, when I want to run anything requiring internet access, I will get a timeout.
when I log in on the VM and I try to ping anything, I will get timeout as well.

When I do a network-admin, the DNS Tile shows only the IPv6 address of the Pi-Hole.
Likewise in the resolve.conf.

When I manually add the address of my Fritzbox and fritz.box as search domain, Internet is working. When I open resolve.conf I can see the Fritzbox IP and search domain.

But only about one minute later the resolve.conf updates and there is again only the Pi-Hole IP in there, and Internet access will time out again.

Can You please give me a hint, where to change this behaviour?
Fritzbox is my my Router and gives always the same IP to Pi-Hole VM.

If you need any more infos, let me know

thx + greetz

Try Configure a static network adddress on your Pi in /etc/network/interfaces section @ raspbian - How do I set up networking/WiFi/static IP address? - Raspberry Pi Stack Exchange

Hi spacemonkey

thx for your reply
Curious results...

When I use the network interface method mentioned in your link and set it to a fixed (different) ip, I get the following error:
# sudo systemctl disable dhcpcd
Synchronizing state for dhcpcd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d dhcpcd defaults
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "de_DE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("de_DE.UTF-8").
insserv: warning: current start runlevel(s) (empty) of script dhcpcd' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dhcpcd' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d dhcpcd disable
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "de_DE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("de_DE.UTF-8").
insserv: warning: current start runlevel(s) (empty) of script dhcpcd' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dhcpcd' overrides LSB defaults (0 1 6).
Same when I use # sudo systemctl enable networking

After reboot, it still had the dhcpcd given IP, Internet was working, but Pi-hole didn't.

When looking in the dhcpcd.conf, everything looks like in the dhcpcd-method described in your link.
Pi-Hole is working now again, but no inet on the Debian vm

Don't forget to run pihole -r and input the static address.
I have never encountered the perl language error. Perhaps google it?

You will be able to reach the machine using that IP until the router's dhcp lease time expires.

You can browse sites with pi-hole?
Some routers deny access to devices in the dhcp range, but don't have a dhcp lease. So when u set a static IP, make sure it's outside the router's dhcp range.

Hello again

I could fix the locales (edited /etc/default/locales) so the perl error is gone.

I then edited the /etc/network/interfaces to static

When running sudo systemctl disable dhcpcd I get:

Synchronizing state for dhcpcd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d dhcpcd defaults
insserv: warning: current start runlevel(s) (empty) of script dhcpcd' overrides LSB defaults (2 3 4 5)._ _insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dhcpcd' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d dhcpcd disable
insserv: warning: current start runlevel(s) (empty) of script dhcpcd' overrides LSB defaults (2 3 4 5)._ _insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dhcpcd' overrides LSB defaults (0 1 6).

sudo systemctl enable networking look ok:
Synchronizing state for networking.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d networking defaults
Executing /usr/sbin/update-rc.d networking enable

after reboot I get the new IP, the static IP is outside the DHCP-Range of my router, so thats ok too
But still no internet, so pihole -r can't fetch lists (tried both, repair and reconfigure)

Pi-hole isn't working for the clients, too

greetz

Is this NAS a Synology running Debian in a chroot/jail?

Hello DanSchaper

no its a Qnap TS-253A running Debian in Virtualisation Station

greetz

Thanks, just wanted to check and see if you may be running in a chroot, as that requires some pretty specific configuration. I'll let the folks with a Fritz! device help you out, I don't have one myself so @spacemonkey is doing a great job helping you.

@DanSchaper

thx for your help, too

As mentioned in the first post, pihole was doing fine so I don't think its a issue with the VM/NAS environment in general
Only when I wanted to update the lists, I noticed, that this didn't work.
Also when putting the Fritzbox IP in the network-admin panel, it updated the /etc/resolve.conf and I got internet for a minute, till resolve.conf was set back by an unknown (to me) cause

greetz

Try adding no-poll to /etc/dnsmasq.d/02-pihole.conf and reboot

Hello @spacemonkey

there is only 01-pihole.conf file there. Should I create the 02 file?
And then just write -n?

Yes, in the new file

no-poll

no change so far.
When I add the Fritzbox ip to resolve.conf, its working until after reboot, then its gone, thus no internet again

What I don't understand:
In the 01-pihole.conf file there is set no-resolve, as I read the manpages, that means it doesn't take the Nameserver IP from the resolve.conf file. no-pull means something equal, doesn't it?
Then why it works as long there is the name server manually added to resolve.conf?

You're right. no-resolve makes no-poll useless. Can you ping IPs?
PS: I don't own a fritzbox or Qnap.

No pings
But still thx a lot for you trying to help

I have done some further reading

Manpages states for the --no-resolv flag witch is dynamically set in the 01-pihole.conf:

[quote] -R, --no-resolv
Don't read /etc/resolv.conf. Get upstream servers only from the command line or the dnsmasq configuration file..
[/quote]

As I understand that, changes should be made in dnsmasq.conf

So I tried with an alternate resolve.conf file (resolvenew.conf) and added nameserver there, then uncommented resolve-file=/etc/resolvenew.conf in /etc/dnsmasq.conf, still not working.

running out of ideas

Edit: As long I add the Fritzbox IP in network-admin, it is working. That means it still reads resolve.conf.
But after restart resolve.conf is cleaned again. There must be a daemon/task that changes resolve.conf

Added my pinhole -d log: vkxujptkv8

This was only working, when I manually put router IP to resolve.conf

fyi, I just did a fresh Install (Debian+Pihole) and this time everything works:+1: