Home Assistant Community Add-on: Pi-hole

I set the port for the web interface to 82.

But, I am still not able to reach the WebGui by typing https://192.168.178.1:82/admin. Reaching the interface from HA is no problem.

What am I doing wrong?

Edit: changing from https to http seems to work. But, pi hole is not accepting the login credentials. I typed in my HA login credentials. The right user should be named pihole, but I do not know the actual password and how to change that.

FWIW, in case it helps anyone else, nothing I did based on all the docs I read would help show local hostnames in pi-hole, UNTIL I switched to ā€œlisten on all interfacesā€ rather than ā€œlisten only on interface eth0ā€. Iā€™m running DHCP on my AsusWRT-merlin router rather than the pi-hole itself, and I updated the host.list file there, turned on conditional forwarding, added all the proper IPs in the proper places according to everthing I read. But nowhere did I read anything about switching the interface listening behavior affecting this issue.

Hi all, Iā€™ve been searching for a solution since yesterday, when I installed this add-on on Hass.io, but with no luck so I hope this wasnā€™t already ansered.

I canā€™t see hostnames in the add-on dashboard, no matter what I do, only IP addresses.
Pi-hole add-on is the DHCP server of my LAN and I can see it blocking requests from the clients.
I flagged ā€œListen on all interfaces, permit all originsā€ but all I obtained was to be able to manually call a nslookup on a LAN hostnames from the SSH add-on connection but manually forcing the DNS in the command.

Did I forget anything?

I assume that for pihole to work my web browsing devices need to route their traffic via the rpi. How does this happen? For example my broadband router does not allow user defined dns addresses.
Am I misunderstanding something?

Perhaps turn the DHCP off on your broadband router and use DHCP in pihole?

I have just manually defined DNS on my windows laptop/desktop as they donā€™t leave my wifi.

Iā€™m still trying to figure this same exact problem with Caddy as a reverse proxy and pihole running in a docker image. Did you ever solve this?

Does anyone know where adlists.list is stored on the pi? I canā€™t remove entries from the interface so thought I could remove it directly.

I donā€™t sorry, but couldnā€™t you just use the whitelist capability or maybe I am misunderstanding?

hi guys,
could someone please help i cant seem to find an answer to swapping the cleint ip for a choose name.

ive added the following yet il only see the ip address in pi hole

  "hosts": [
    {
      "name": "Davids-IPad",
      "ip": "10.0.0.18"
    },
    {
      "name": "Davids-Phone",
      "ip": "10.0.0.11"
    }
  ]
}

my router is managing all dhcp

@phairplay: You may need to enable Settings -> DNS -> Use conditional forwarding

For everyone else - I have a question. Is there a standard way to modify dnsmasq configuration? I want to force ā€œsafe searchā€ by overriding some domains:

sudo nano /etc/dnsmasq.d/05-restrict.conf
# reference: https://support.opendns.com/hc/en-us/articles/227986807-How-to-Enforcing-Google-SafeSearch-YouTube-and-Bing
# https://www.leowkahman.com/2017/09/11/enforce-safe-search-on-google-youtube-bing/

# Google safe search (Copy from OpenWRT link)

# YouTube restricted
# you can also implement a moderate setting replace restrict.youtube.com with restrictmoderate.youtube.com
cname=youtube.com,restrictmoderate.youtube.com
cname=www.youtube.com,restrictmoderate.youtube.com
cname=m.youtube.com,restrictmoderate.youtube.com
cname=youtubei.googleapis.com,restrictmoderate.youtube.com
cname=youtube.googleapis.com,restrictmoderate.youtube.com
cname=youtube-nocookie.com,restrictmoderate.youtube.com
cname=www.youtube-nocookie.com,restrictmoderate.youtube.com

# Bing safe search
cname=bing.com,strict.bing.com
cname=www.bing.com,strict.bing.com

sudo nano /etc/hosts
216.239.38.120  restrict.youtube.com
216.239.38.119  restrictmoderate.youtube.com
216.239.38.120  forcesafesearch.google.com
204.79.197.220  strict.bing.com

Any suggestions on how I could do that in a way that is preserved by the container restart?

Edit: I see this is exposed outside of the container: /usr/share/hassio/addons/data/a0d7b954_pi-hole/dnsmasq.d/. Iā€™ll give it a goā€¦

1 Like

Edit 2: Ok, to force safe search you can do the following:

  1. Edit the Hassio Pihole configuration and set these hosts:
  "hosts": [
    {
      "name": "restrict.youtube.com",
      "ip": "216.239.38.120"
    },
    {
      "name": "restrictmoderate.youtube.com",
      "ip": "216.239.38.119"
    },
    {
      "name": "forcesafesearch.google.com",
      "ip": "216.239.38.120"
    },
    {
      "name": "strict.bing.com",
      "ip": "204.79.197.220"
    }
  ]
  1. Create this file (check the path):
# vi /usr/share/hassio/addons/data/*_pi-hole/dnsmasq.d/10-safesearch.conf
# reference: https://support.opendns.com/hc/en-us/articles/227986807-How-to-Enforcing-Google-SafeSearch-YouTube-and-Bing
# https://www.leowkahman.com/2017/09/11/enforce-safe-search-on-google-youtube-bing/

# Google safe search (Copy from OpenWRT link)

# YouTube restricted
# you can also implement a moderate setting replace restrict.youtube.com with restrictmoderate.youtube.com
cname=youtube.com,restrictmoderate.youtube.com
cname=www.youtube.com,restrictmoderate.youtube.com
cname=m.youtube.com,restrictmoderate.youtube.com
cname=youtubei.googleapis.com,restrictmoderate.youtube.com
cname=youtube.googleapis.com,restrictmoderate.youtube.com
cname=youtube-nocookie.com,restrictmoderate.youtube.com
cname=www.youtube-nocookie.com,restrictmoderate.youtube.com

# Bing safe search
cname=bing.com,strict.bing.com
cname=www.bing.com,strict.bing.com

Restart pihole and test:

$  dig @192.168.228.203 www.youtube.com

; <<>> DiG 9.11.3-1ubuntu1.10-Ubuntu <<>> @192.168.228.203 www.youtube.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9143
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.youtube.com.		IN	A

;; ANSWER SECTION:
www.youtube.com.	2	IN	CNAME	restrictmoderate.youtube.com.
restrictmoderate.youtube.com. 2	IN	A	216.239.38.119

;; Query time: 2 msec
;; SERVER: 192.168.228.203#53(192.168.228.203)
;; WHEN: Sun Nov 10 14:59:00 EET 2019
;; MSG SIZE  rcvd: 102

Thanks for the addon!

This question is for anyone i just selected the last post, anyways does anyone know how i can modify the pihole directory from hassio addons? i have static address i have prepped from a stand alone pihole instance that i would like to copy over, i would also like to install cloudflared over https onto the hassio platform. Any Ideas?

Configuration lives at /usr/share/hassio/addons/data/*_pi-hole/

hi, iā€™ve a problem with this add-on. Iā€™ve hassio on armbian and sometimes when i reboot it or energy go down when it restart (sometimes) iā€™ve this error:

[18:47:21] INFO: Starting NGinx....
nginx: [emerg] invalid number of arguments in "resolver" directive in /etc/nginx/includes/resolver.conf:1

i donā€™t understand what appened, can you help me? thanks

Hello,

first of all, thank you for this great addon. During the installation of hass.io Iā€™ve set a static dns server, for which Iā€™ve configured to use cloudlfare. It seems like the Pi-Hole addon changes the preconfigured static dns server:

Log at addon startup:

[2020-01-03 19:24:40.610 871] New forward server: 8.8.4.4 (0/512)
[2020-01-03 19:24:40.610 871] New forward server: 8.8.8.8 (1/512)

Is there any possibility to change the dns-Server Pi-Hole is using?

Thank you in advance :smiley:

Yes this is available in the dns settings of pi hole itself.

Thanks Frenck, for putting your time into this.

Iā€™m getting the following error whenever I start the DNS server. I only just installed it and have no idea where to start with troubleshooting.

2020/01/18 15:31:45 [error] 780#780: *152 FastCGI sent in stderr: "PHP message: PHP Warning:  unlink(../custom_disable_timer): No such file or directory in /var/www/html/admin/api.php on line 47" while reading response header from upstream, client: 172.30.32.2, server: a0d7b954-pi-hole, request: "GET /api.php?enable=&token=<redacted>%3D HTTP/1.1", upstream: "fastcgi://127.0.0.1:17276", host: "192.168.1.130:8123", referrer: "http://192.168.1.130:8123/api/hassio_ingress/<redacted>"
  • Hass.io version 0.103.6
  • Iā€™ve setup my routerā€™s DHCP with the hass.io serverā€™s IP address.

Any idea whatā€™s going on?

Im having problems with the add-on, would you guys help me?

These are my settings:

I have an asus with merlin and the DNS Server 1 is the ip of my NUC.

What am I doing wrong? Iā€™ve been able to make it work with my RPI before.

Tue Jan 21 2020 23:37:55 GMT-0600 (CST)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 419, in _async_add_entity
    await entity.async_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/pi_hole/sensor.py", line 65, in state
    return round(self.data[self._condition], 2)
KeyError: 'domains_being_blocked'

hey all,
I had hass.io running on ubuntu 18.04 with the pi-hole docker add-on all fine until I uninstalled pi-hole today. Since then the internet on the ubuntu machine is broken. All local ip addresses are fine: I can visit my local hass.io front-end and other local pages like my router, vacuum robot and a few sonoffs, but anything thatā€™s not local doesnā€™t work. I can also succesfully ping to 1.1.1.1 and 8.8.8.8
Iā€™ve found a few similar problems in google but not yet a solution.
Recovering a snapshot doesnā€™t fix it: the pi-hole add-on doesnt start. No such image: hassioaddons/pi-hole-amd64:4.0.0

Hi Community
Is there a way to add to the blacklist (or even remove from blacklist) via RESTful API. Would love to change the list when certain condition(s) are met.
Thanks