Home Assistant Community Add-on: Pi-hole

Guys… I set a bunch of hosts in the addon config panel, but I still get the IP’s on the dashboard showing the requests. Is this normal behaviour? Shoulnd’t I be seeing the names instead?

After installing and enabling Pi-hole on my HA instance (went fine!) I am unable to use HA Cloud and also sending messages to Pushover stopped working. When I stop the Pi-hole addin everything works fine again.

I adjusted my DHCP so it sets the address of HA as DNS, my Pi is also on DHCP so it has its own DNS. Is this the issue and what is the best workaround for it? Entering static DNS?

Yes set a static DNS like google dns: 8.8.8.8

That works great indeed!

For any other who finds this: if you are running Resin OS you can place a file (by example resin-eth0 as filename) on you SD card in the folder /system-connections/ with this content (adjusted to your needs):

[connection]
id=Ethernet
type=ethernet
interface-name=eth0

[ipv4]
method=manual
address1=192.168.2.5/24,192.168.2.1;
dns=192.168.2.1;

Is it possible to add a configuration option to chose the blocking mode so that we can optionally get the blocked by Pi-Hole page? https://docs.pi-hole.net/ftldns/blockingmode/

1 Like

No that is currently not possible using this add-on. We have had this in the past, this add a lot of complexity to the add-on and is more error prone. Not sure if this will return.

:tada: Release v2.1.0

Full Changelog

  • Upgrades bind-tools to 9.12.2_p1-r0
  • Upgrades ncurses to 6.1_p20180818-r1
  • Upgrades nginx to 1.14.0-r1
  • Upgrades base image to v2.3.0
  • Adds Hassio API role to configuration
  • Upgrades GCC/G++ to 6.4.0-r9
  • Upgrades OpenSSL to 1.0.2p-r0
  • Upgrades PHP to 7.2.10-r0

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

For UBUNTU-NUC with the problem “dnsmasq: failed to create listening socket for port 53: Address in use” you have to disable “systemd-resolved.service”.

To se what is running on the host with the port 53 you can type :
sudo netstat -nlpt | grep :53
OR
sudo lsof -i tcp:53

To disable this service take a look here:

It can trigger board effects especially with VPNs so read this carrefully :wink:

1 Like

how did you solve the below issue.

Failed Host Check: XXX.duckdns.org vs 192.168.1.35, , hassio.local, pi.hole, localhost, hassio, hassio.local, https://XXX.duckdns.org

192.168.1.35 is the ip address of my pi running hass.io

im not able to find the solution for this. apologies if it was answered before.

{
  "log_level": "info",
  "password": "XXX",
  "update_lists_on_start": false,
  "admin_port": 4865,
  "dns_port": 53,
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "interface": "",
  "ipv6": true,
  "ipv4_address": "",
  "ipv6_address": "",
  "virtual_host": "https://XXX.duckdns.org",
  "hosts": []
}

im not able to get it work on ipanel also.

  pihole:
    title: Pi-hole
    icon: mdi:block-helper
    url: https://XXX.duckdns.org:4865

I just installed the addon changed the password and virtual host. is there another step i am missing. i read that DNS in router needs to point to the server running Pi-hole. should it be done.

Try updating the virtual_host so it would match, I think you should remove the ‘https://’ in front of it.

Hi there,

I’ve installed the pi-hole addon today. Either Hassio and PiHole are up to date:

My config:

  {
   "log_level": "info",
   "password": "*********",
   "update_lists_on_start": false,
   "admin_port": 8129,
   "dns_port": 53,
   "ssl": true,
   "certfile": "fullchain.pem",
   "keyfile": "privkey.pem",
   "interface": "",
   "ipv6": true,
    "ipv4_address": "",
    "ipv6_address": "",
    "virtual_host": "*******.duckdns.org",
    "hosts": []
}

sensor setup:

   - platform: pi_hole
  host: localhost
  monitored_conditions:
- ads_blocked_today
- dns_queries_today
- unique_clients
  ssl: true

Errors in the logs:

Unable to fetch data from Pi-hole
Can not load data from *hole: localhost

It seemed to me that it has to do with te setup. But i can’t get to the right configuration.
Does anyone have a fix?

Note that i use a custom port number, but adding that to the host options doesn’t make sense.

How to use the sensor is documented here.
Ofcourse you need to adjust the port because you changed it, as shown below.

sensor:
  - platform: pi_hole
    host: localhost:8129
    monitored_conditions:
      - ads_blocked_today
      - dns_queries_today
      - unique_clients
    ssl: true

Why do you say it wouldn’t make sense to add it to the host? By default it assumes the admin interface is on port 80.

In order to use pi hole, we have two options of router configurations.

  1. Enable DHCP on Pi-hole settings and turn off DHCP on router.
  2. Set pi hole address as DNS Server in router.

What are the pro and cons of each of the alternative? Just trying to learn more in order to make informed decision.

That kinda depends on your router. For example, some routers proxy the DNS requests to Pi-hole instead of giving out the IP of Pi-hole a the DHCP request. This makes he stats and info in Pi-hole pretty useless, since all requests would be made by one client: your router.

There are more examples, but this gives you a idea. It all depends on your router and its capabilities.

I’ve been stuck with 1 issue and it has to do with sensor information.

Unable to fetch data from Pi-hole
3:20 PM components/sensor/pi_hole.py (ERROR)

Can not load data from *hole: localhost:4865
3:20 PM util/async_.py (ERROR)

Here’s my sensor initialization in config.yaml

# Sensors
sensor:
  - platform: pi_hole
    host: localhost:4865
    monitored_conditions:
      - ads_blocked_today
      - dns_queries_today
      - unique_clients
    ssl: true

I’ve tried every host possible from all the different ways I have to connect to the pihole dashboard.

*****.duckdns.org:4865
https://*****.duckdns.org:4865
192.168.0.***:4865
https://192.168.0.***:4865
hassio.local:4865
https://hassio.local:4865
localhost:4865

Here’s my pihole addon configuration

{
  "log_level": "info",
  "password": "*************************************",
  "update_lists_on_start": false,
  "admin_port": 4865,
  "dns_port": 53,
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "interface": "eth0",
  "ipv6": false,
  "ipv4_address": "",
  "ipv6_address": "",
  "virtual_host": "*****.duckdns.org",
  "hosts": [
    {
      "name": "*****.duckdns.org",
      "ip": "192.168.0.***"
    }
  ]
}

I can access the dashboard remotely from anywhere with no trouble. Either straight from duckdns.org or HA frontend. The last thing that I can’t fix is this sensor issue.

This is a known issue, which should be fixed in the next HA release.

I have set up Pi hole and it works but I am having trouble with all of my port forwarding.

When I check to see if my ports are open using https://portchecker.co/ it says they are closed if Pi hole is running. If I turn off Pi hole they are open again.

my pi hole stopped working in hassio.

whenever i try to manually start it, the button in hassio turns red and there is nothing in the logs, no matter how often I click on refresh in the log section. any idea what might be going wrong? did I miss something after upgrading hassio to 0.80 and above?

I also tried uninstalling and reinstalling pi-hole with no luck. is there anything cached that I can delete?

I am having trouble getting my client names to show up in pihole. I am running a UniFI setup with a USG. All of my googling hasn’t helped.

Hard to follow this thread, but it’s unclear whether this issue has been solved.
I too am having issues that the yr.no value is now reading as unknown, and has been so since I enabled the Pi-Hole addond