No internet on OSMC after installing Pi-hole (also using the Pi-hole as DHCP server)

Hi

I installed the latest OSMC on my RPI 3 b+ and also PI-hole (I am also using the Pi-hole as my DHCP server)

I was able to configure Pi-hole and I have internet on my PC and on my phone in the house WiFi. The ads are blocked, so Pi-hole works!

However I have no internet access anymore on the OSMC. I connect with ssh and there’s no reply from ping www.google.com

I will share my settings with you:

PC → PI-hole (with DHCP server enabled) → Router (with google upstream DNS in the WAN settings)

PI-hole is 192.168.1.62 → this is a static IP (I checked /etc/dhcpcd.conf) and I have this:

interface eth0
static ip_address=192.168.1.62/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1

This is what I have in /etc/resolv.conf

Generated by dhcpcd from eth0.dhcp

/etc/resolv.conf.head can replace this line

nameserver 127.0.0.1

/etc/resolv.conf.tail can replace this line

My Pi-hole DNS points to the router
https://imgur.com/wJyAiSX

The PI-hole DHCP config looks like this.
https://imgur.com/bGyvrVk

Now on the Router LAN side I point to the Pi-hole
https://imgur.com/juKcanW

I have disabled the router DHCP server and added the Pi-hole IP in the DNS Server: 192.168.1.62

On the Router WAN side I point to the Google DNS
https://imgur.com/C788byt

Pi-hole works as a DHCP server also. The ads are blocked, but the strange part is this. When I restart my OSMC with ‘sudo reboot’ after I connect back I get a result back from the

ping google.com…but only for a few seconds

Can anyone please help me?

PiHole and OSMC do not sit well together, as you’ve found. The “only for a few seconds” problem is very likely to do with connman and dhcpcd battling for control of your system.

The bottom line is that you should place PiHole on another device.

Hi,

Its not recommended to install pihole on osmc, as it installs packages which breaks connman.

I would backup your settings and reinstall osmc without pihole.

Thanks Tom.

oh no :frowning: Is there really no workaround? OSMC + pihole make a perfect mix in theory. I have my media center which also blocks the ads.

Is this an issue of Pihole or of OSMC? I wonder if I could open a bug somewhere. What do you recommend?

Disable dhcpd on the Pi, and use your router as the DHCP server. Configure it with the same settings that dhcpd on the Pi had, and that will likely work, assuming other packages aren’t disrupting the Pi connman setup.

I see. I have to say this is very disappointing. Especially as there is no solution for this cohabitation. It’s one or another.

I really thought that OSMC would be the best compromise between Raspbian and LibreElec for a base OS where I could then install Pi-hole, but it seems there’s no possibility to do this.

I’ll try to install Raspbian + Kodi, make it automatically start Kodi and then install Pi-hole.

Thanks for the info guys.

As @nabsltd says, you can hack PiHole so it will probably work, but PiHole and OSMC don’t sit well together without some “adjustments” and might break again after updates. I’m also not sure how critical dhcpcd is to the correct functioning of PiHole.

It’s not except that whatever DHCP server is used, the pi must be configured as DNS server for the local devices.

This shouldn’t be a problem. Just set up the Pi to use a static IP, and configure your router to give out the Pi’s IP address as the DNS server to the DHCP clients.

To configure a static IP, do the following:

connmanctl services

This will return the connman service name of your ethernet adapter. Let’s call it EthernetName.

Then,

connmanctl config EthernetName ipv4 manual address netmask gateway
2 Likes

Awesome. Thank you so much for this.