Home Assistant Community Add-on: Pi-hole

Maybe you have another add-on running that is using port 53 and creating the conflict. Try changing the port number in the add-on settings.

After updating to 4.0, i get this in the log:

[2019-08-26 20:53:09.496 761] Finished config file parsing
[2019-08-26 20:53:09.503 761] Database version is 3
[2019-08-26 20:53:09.503 761] Database successfully initialized
[2019-08-26 20:53:09.505 761] SQLite3 message: database corruption at line 65183 of [0eca3dd3d3] (11)
[2019-08-26 20:53:09.505 761] SQLite3 message: statement aborts at 4: [SELECT * FROM queries WHERE timestamp >= 1566759189] database disk image is malformed (11)
[2019-08-26 20:53:09.506 761] Imported 0 queries from the long-term database
[2019-08-26 20:53:09.506 761] read_data_from_DB() - SQL error step (11): database disk image is malformed
[2019-08-26 20:53:09.506 761] dbclose() - SQL error (5): unable to close due to unfinalized statements or unfinished backups
[2019-08-26 20:53:09.506 761] check_database(11): Disabling database connection due to error
[20:53:09] INFO: Starting NGinx....
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)

Also, i’m using DuckDNS addon with pi-hole, and i never get to use my duckdns domain to get into pihole, i always have to use the direct ip, else, i get a blank page with only:

“Failed Host Check: xxxxxx.duckdns.org vs 192.168.0.48, , a0d7b954-pi-hole, pi.hole, localhost, xxxxxx, xxxxxx.local”
where xxxxxx is my ducdkns domain

Pi_hole sensor stopped working after the update. Is this a known issue? Do we need to change the config for the update?

I got the same behavior.
Solved it by removing the ssl and verify ssl settings, give it a try

this fixed it, thanks

HI All. First off I want to say how much I love this add on.
I run this add on as well as another pi-hole on an older raspberry pi to block all those dns adds

One thing which occurred after upgrading to 4.0 is that I can no longer temporarily turn off pi-hole as described in this post

Essentially because there is no password, there is no API key, and running the curl commands fails.
Does anyone know of some commands to turn off pi hole without the API key, I have tried it without the key but it says “not authorised”

Thanks all

2 Likes

I have this same setup and I was able to make it work by just removing the API key and making it like in the example since the example doesn’t use the API key either. I can try to help more if you don’t have any luck.

@frenck Is there is a reason that the host UDP port 67 for DHCP is not mapped to the container?

I want to use pi-hole as DHCP server as that means, I will be able to resolve hostnames of my dhcp clients.

For now I edited the hassio addons.json file to allow UDP/67

That makes absolutely no sense, since it runs on the host network. Those aren’t rocker mappings in that config file.

@frenck Ok, I wasn’t aware that it’s run on the host network. I am not sure why this is the case but DHCP was not being offered until I mapped UDP/67

I will remove the mapping and try again. Will update soon.

Apologies! User error!!

I think I might not have had my previous DHCP server stopped when I configured pi-hole addon.

Is This block youtube AD?

No, it does not. DNS based ad blockers never do.

Installed Pi-hole, everything seems to work nicely. Set up my router to use my Home Assistant installation on my RPi3 as DNS. I cannot open the web interface though. I get the follow error.

Failed Host Check: My.external.ip vs my.local.ip, , a0d7b954-pi-hole.local.hass.io, pi.hole, localhost, hassio, hassio.local

Any clues? I have tried not using ssl.

1 Like

Using Hassio and looking to use the pihole API for a on/off browser addon, however it fails to generate key as no password is set. I cannot see any way to define a password for this?

Any help appreciated!

Hello, i’ve think i made a very tiny mistake.
Everything works almost perfect, let me explain my installation on hassio:

  • Install addon
  • add eth0 to the interface settings
  • add the addres of my duckdns instance to virtual host
  • start, so far so good.
  • turned the dhcp of my router off

Pi-Hole settings

  • dhcp settings: put in the same range as my router
  • dhcp settings: here i give the pi with hassio and pihole a static ip (same as i used before
  • turned one the dhcp of pi-hole

My device settings

  • Use the ip of the pi for as DNS adress.

From now on everytings works great.
I can see ads are blocked and a few dhcp ip’s are handed out to a few devices (the pi not yet).
After an hour or so the internet connection stops and i can’t do anything anymore.

When i go back to my router and put the DHCP on, i have acces to internet again…

What am i missing?
I think as soon as the pi get an ip from the pi-hole instance, the internet breaks.

Thanks!

Tried the following:

Added this to the pi-hole addon config:

  "hosts": [
    {
      "name": "router.local",
      "ip": "192.168.1.1"
    }
  ]
}

Also removed the static DHCP lease for the pi with pi-hole, i thought maybe that was the thing causing the problem…

Did not work, after a few hours the internet connection is gone.

When i enable the DHCP on the router the internet connection is back immediately.
The first thing i see on the router is that the pi ip adres is directly added to the DHCP lease…

I also keep the DHCP service on the pi running, my laptop still used the pi-hole dns and dhcp addres…
Can i keep the 2 DHCP services running together?

For now there are no issues…

I added a switch that looks like:

  - platform: command_line
    scan_interval: 5
    switches:
      pihole_switch:
        friendly_name: "Ad Blocking"
        command_on: "curl -X GET 'http://homeassistant:4865/admin/api.php?enable&auth='"
        command_off: "curl -X GET 'http://homeassistant:4865/admin/api.php?disable=600&auth='"
        command_state: "curl -X GET 'http://homeassistant:4865/admin/api.php?status&auth='"
        value_template: "{{ value_json.status == 'enabled' }}"

The empty auth handles no password.

Thanks but I am looking for this from a browser plugin. Cant see why there is no way to password protect this?

I’ve had PiHole running for months and I am now getting the same issue - Did you ever work out what was causing this or how to fix it?