Home Assistant Community Add-on: Pi-hole

@anon35356645, Yep! That is possible (and how I use it myself as well).

Goto Settings -> DHCP in the admin panel. There you’ll find an option to add static DHCP leases.

You mean in the web interface not setting In hassio addon?
192.168.1.12/admin

Currently I use pihole in a separate pi3 (i have HASSIO on a Ubuntu NUC),

Yep, the Pi-hole admin interface.

Is this version with ftldns? Don’t understand much if this feature is out or not

All add-on versions support running Pi-hole as the DHCP server for you netwerk.
All Pi-hole features are supported in this add-on.

If you have questions about Pi-hole features, I suggest to check with the Pi-hole website/documentation/forum.
This add-on simply provides Pi-hole.

Ok, thanks. So you assign the MAC address from the web interface (as above) but you assign hosts names in the addon settings (not web interface)?

Is it the same using the addon settings or web interface for assigning hosts names (192.168.1.1 ===> printer.lan and so on)?

Pi-hole does not support adding additional hostnames to support, that feature is requested a lot, so I’ve added it to the add-on configuration.

Add-on configuration = features by this add-on.
Webinterface = Pi-hole.

There is no overlap between those 2.

Not support? In my pihole installation (normal not hassio addon) I change names in the web interface (the one you posted): when you add a static IP + mac address + you can also assign the name too. Plus in the web interface there is a possibility to put pihole domain name, where I put “lan”.

So now at, for example, 192.168.1.12 I assigned the static IP address of my Ubuntu NUC mac address , I also assigned the hostname Ubuntu. So now 192.168.1.12 or ubuntu.lan is the same thing

Just wondering if the web interface names conflicts with the addon settings names

@anon35356645 The hostnames the can be defined in the add-on configuration is for statically defined hosts.

E.g. your printer has a static IP… So DHCP has nothing to do with it… how do you define a hostname? That is where the add-on option kicks in.

Please search on Pi-hole forums (and the add-on issues) for more information about this and why this feature was added.

CCould anyone give me some assistance setting up pihole?
I am using duck dns with letsencrypy to allow access to my hassio. I have installed pihole but can not access the web ui think it is due to the ports being used by lets encrypt.

This is my config:

     {
     `"log_level": "info",
      "password": "xxxx",
      "update_lists_on_start": false,
      "http_port": 85,
      "https_port": 443,
      "dns_port": 53,
      "ssl": false,
      “certfile": "fullchain.pem",
      “keyfile": "privkey.pem",
      "ipv6": true,
      "ipv4_address": "",
      "ipv6_address": "",
      "virtual_host": "",
      "hosts": []
    }
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying... 
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] 01-sudo: applying... 
[fix-attrs.d] 01-sudo: exited 0.
[fix-attrs.d] 02-nginx: applying... 
[fix-attrs.d] 02-nginx: exited 0.
[fix-attrs.d] 03-pihole: applying... 
[fix-attrs.d] 03-pihole: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Pi-hole v1.0.0
 Network-wide ad blocking using your Hass.io instance
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 03-version-requirements.sh: executing... 
[cont-init.d] 03-version-requirements.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-patches.sh: executing... 
[cont-init.d] 11-patches.sh: exited 0.
[cont-init.d] 11-pihole.sh: executing... 
[cont-init.d] 11-pihole.sh: exited 0.
[cont-init.d] 12-dnsmasq.sh: executing... 
[cont-init.d] 12-dnsmasq.sh: exited 0.
[cont-init.d] 13-nginx.sh: executing... 
[cont-init.d] 13-nginx.sh: exited 0.
[cont-init.d] 14-password.sh: executing... 
  [✓] New password set
[cont-init.d] 14-password.sh: exited 0.
[cont-init.d] 15-hostname.sh: executing... 
[cont-init.d] 15-hostname.sh: exited 0.
[cont-init.d] 16-logfiles.sh: executing... 
[cont-init.d] 16-logfiles.sh: exited 0.
[cont-init.d] 17-hosts.sh: executing... 
[cont-init.d] 17-hosts.sh: exited 0.
[cont-init.d] 50-gravity.sh: executing... 
[cont-init.d] 50-gravity.sh: exited 0.
[cont-init.d] 99-tests.sh: executing... 
dnsmasq: syntax check OK.
[23-Mar-2018 17:04:33] NOTICE: configuration file /etc/php7/php-fpm.conf test is successful
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[cont-init.d] 99-tests.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
starting version 3.2.4
[services.d] done.



Debug logfile:

[cont-init.d] 12-dnsmasq.sh: executing... 
DEBUG: Symlinking configuration
DEBUG: Setting dnsmasq interface
DEBUG: Detecting interface
DEBUG: Setting interface to: eth0
DEBUG: Setting dnsmasq port
DEBUG: Setting dnsmasq port to: 53
[cont-init.d] 12-dnsmasq.sh: exited 0.
[cont-init.d] 13-nginx.sh: executing... 
[cont-init.d] 13-nginx.sh: exited 0.
[cont-init.d] 14-password.sh: executing... 
  [✓] New password set
[cont-init.d] 14-password.sh: exited 0.
[cont-init.d] 15-hostname.sh: executing... 
DEBUG: Requested API resource: http://hassio/supervisor/ping
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {}}
DEBUG: Requested API resource: http://hassio/host/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"type": "resinos", "version": "1.3", "last_version": "1.3", "features": ["shutdown", "reboot", "update", "hostname"], "hostname": "hassio", "os": "GNU/Linux"}}
DEBUG: Filtering response using: .hostname
[cont-init.d] 15-hostname.sh: exited 0.
[cont-init.d] 16-logfiles.sh: executing... 
[cont-init.d] 16-logfiles.sh: exited 0.
[cont-init.d] 17-hosts.sh: executing... 
[cont-init.d] 17-hosts.sh: exited 0.
[cont-init.d] 50-gravity.sh: executing... 
[cont-init.d] 50-gravity.sh: exited 0.
[cont-init.d] 99-tests.sh: executing... 
DEBUG: Testing if all configurations valid
dnsmasq: syntax check OK.
[23-Mar-2018 18:40:38] NOTICE: configuration file /etc/php7/php-fpm.conf test is successful
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[cont-init.d] 99-tests.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
starting version 3.2.4
[services.d] done.
[2018-03-23 18:40:38.371] ########## FTL started! ##########
[2018-03-23 18:40:38.374] FTL branch: master
[2018-03-23 18:40:38.374] FTL version: v3.0
[2018-03-23 18:40:38.374] FTL commit: a1b2fa0
[2018-03-23 18:40:38.375] FTL date: 2018-02-14 12:45:47 -0800
[2018-03-23 18:40:38.375] FTL user: pihole
[2018-03-23 18:40:38.375] Notice: Found no readable FTL config file
[2018-03-23 18:40:38.375]         Using default settings
[2018-03-23 18:40:38.375] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2018-03-23 18:40:38.375]    SOCKET_LISTENING: only local
[2018-03-23 18:40:38.375]    QUERY_DISPLAY: Show queries
[2018-03-23 18:40:38.375]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2018-03-23 18:40:38.375]    MAXDBDAYS: max age for stored queries is 365 days
[2018-03-23 18:40:38.375]    RESOLVE_IPV6: Resolve IPv6 addresses
[2018-03-23 18:40:38.375]    RESOLVE_IPV4: Resolve IPv4 addresses
[2018-03-23 18:40:38.375]    DBINTERVAL: saving to DB file every minute
[2018-03-23 18:40:38.375]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2018-03-23 18:40:38.375]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2018-03-23 18:40:38.384] Finished config file parsing
[2018-03-23 18:40:38.384] WARNING: Unable to write PID to file.
[2018-03-23 18:40:38.384]          Continuing anyway...
[2018-03-23 18:40:38.384] PID of FTL process: 1041
[2018-03-23 18:40:38.451] Gravity list entries: 121566
[2018-03-23 18:40:38.451] No blacklist present
[2018-03-23 18:40:38.451] No wildcard blocking list present
[2018-03-23 18:40:38.452] Database initialized
[2018-03-23 18:40:38.453] SELECT * FROM queries WHERE timestamp >= 1521741660
[2018-03-23 18:40:38.453] Imported 0 queries from the long-term database
[2018-03-23 18:40:38.453] Starting initial log file parsing
[2018-03-23 18:40:38.454] Reading from /var/log/pihole.log (rw-r--r--)
[2018-03-23 18:40:38.454] Detected restart of dnsmasq, increasing loggeneration to 1
[2018-03-23 18:40:38.454] Detected restart of dnsmasq, increasing loggeneration to 2
[2018-03-23 18:40:38.455] Detected restart of dnsmasq, increasing loggeneration to 3
[2018-03-23 18:40:38.456] Detected restart of dnsmasq, increasing loggeneration to 4
[2018-03-23 18:40:38.462] Detected restart of dnsmasq, increasing loggeneration to 5
[2018-03-23 18:40:38.463] Detected restart of dnsmasq, increasing loggeneration to 6
[2018-03-23 18:40:38.464] Finished initial log file parsing
[2018-03-23 18:40:38.464]  -> Total DNS queries: 0
[2018-03-23 18:40:38.464]  -> Cached DNS queries: 0
[2018-03-23 18:40:38.464]  -> Forwarded DNS queries: 0
[2018-03-23 18:40:38.464]  -> Exactly blocked DNS queries: 0
[2018-03-23 18:40:38.464]  -> Wildcard blocked DNS queries: 0
[2018-03-23 18:40:38.464]  -> Unknown DNS queries: 0
[2018-03-23 18:40:38.464]  -> Unique domains: 0
[2018-03-23 18:40:38.464]  -> Unique clients: 0
[2018-03-23 18:40:38.464]  -> Known forward destinations: 0
[2018-03-23 18:40:38.464] Successfully accessed setupVars.conf
[2018-03-23 18:40:38.465] Listening on port 4711 for incoming IPv4 telnet connections
[2018-03-23 18:40:38.465] Found 12 IPv4 and 8 IPv6 capable interfaces
dnsmasq: started, version 2.78 cachesize 10000
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect inotify
dnsmasq: using nameserver 8.8.4.4#53
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: read /etc/pihole/black.list - 0 addresses
dnsmasq: read /etc/pihole/local.list - 4 addresses
dnsmasq: read /etc/pihole/gravity.list - 243132 addresses
dnsmasq: read /etc/hosts.list - 0 addresses

Have changed http port but am now stuck :slight_smile:

Thanks

Log file now posted

@Sluddsy It would help if you pasted logs as well…

can confirm that once I edited the resin sample file for static and dns this was fixed.

1 Like

Can someone suggest the ideal config for a Hassio/DuckDNS/LetsEncrypt setup? Enable SSL? Access from outside?

You will get different answers on this question. It depends on your needs and personal preferences.

:tada: Release v1.0.1

Full Changelog

Fixes

  • Fixes log queries issue on upgrade

My IP is static but I have just set my dns to the following:

8.8.8.8;8.8.4.4

Now getting the following in my logfile:

TRACE: hass.jq.is: /data/options.json .ssl string
TRACE: hass.jq: /data/options.json .ssl | if type=="string" then true else false end
TRACE: hass.jq.is_boolean: /data/options.json .ssl
TRACE: hass.jq.is: /data/options.json .ssl boolean
TRACE: hass.jq: /data/options.json .ssl | if type=="boolean" then true else false end
TRACE: hass.jq: /data/options.json .ssl // false
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-patches.sh: executing... 
TRACE: hass.api.supervisor.ping
TRACE: hass.api.call GET /supervisor/ping
DEBUG: Requested API resource: http://hassio/supervisor/ping
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {}}
TRACE: hass.jq: {"result": "ok", "data": {}}
 .result
TRACE: hass.jq: {"result": "ok", "data": {}}
 if .data == {} then empty else .data end
TRACE: hass.has_value: 
TRACE: hass.api.host.info.hostname
TRACE: hass.api.host.info .hostname
TRACE: hass.api.call GET /host/info false .hostname
DEBUG: Requested API resource: http://hassio/host/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"type": "resinos", "version": "1.3", "last_version": "1.3", "features": ["shutdown", "reboot", "update", "hostname"], "hostname": "hassio", "os": "GNU/Linux"}}
[cont-init.d] 11-patches.sh: exited 0.
[cont-init.d] 11-pihole.sh: executing... 
[cont-init.d] 11-pihole.sh: exited 0.
[cont-init.d] 12-dnsmasq.sh: executing... 
[cont-init.d] 12-dnsmasq.sh: exited 0.
[cont-init.d] 13-nginx.sh: executing... 
[cont-init.d] 13-nginx.sh: exited 0.
[cont-init.d] 14-password.sh: executing... 
  [✓] New password set
[cont-init.d] 14-password.sh: exited 0.
[cont-init.d] 15-hostname.sh: executing... 
[cont-init.d] 15-hostname.sh: exited 0.
[cont-init.d] 16-logfiles.sh: executing... 
[cont-init.d] 16-logfiles.sh: exited 0.
[cont-init.d] 17-hosts.sh: executing... 
[cont-init.d] 17-hosts.sh: exited 0.
[cont-init.d] 50-gravity.sh: executing... 
[cont-init.d] 50-gravity.sh: exited 0.
[cont-init.d] 99-tests.sh: executing... 
[cont-init.d] 99-tests.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2018-03-24 11:53:23.245] ########## FTL started! ##########
[2018-03-24 11:53:23.245] FTL branch: master
[2018-03-24 11:53:23.245] FTL version: v3.0
[2018-03-24 11:53:23.253] FTL commit: a1b2fa0
[2018-03-24 11:53:23.253] FTL date: 2018-02-14 12:45:47 -0800
[2018-03-24 11:53:23.253] FTL user: pihole
[2018-03-24 11:53:23.253] Notice: Found no readable FTL config file
[2018-03-24 11:53:23.253]         Using default settings
[2018-03-24 11:53:23.253] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2018-03-24 11:53:23.253]    SOCKET_LISTENING: only local
[2018-03-24 11:53:23.254]    QUERY_DISPLAY: Show queries
[2018-03-24 11:53:23.254]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2018-03-24 11:53:23.254]    MAXDBDAYS: max age for stored queries is 365 days
[2018-03-24 11:53:23.254]    RESOLVE_IPV6: Resolve IPv6 addresses
[2018-03-24 11:53:23.254]    RESOLVE_IPV4: Resolve IPv4 addresses
[2018-03-24 11:53:23.254]    DBINTERVAL: saving to DB file every minute
[2018-03-24 11:53:23.254]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2018-03-24 11:53:23.254]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2018-03-24 11:53:23.265] Finished config file parsing
[2018-03-24 11:53:23.266] WARNING: Unable to write PID to file.
[2018-03-24 11:53:23.266]          Continuing anyway...
[2018-03-24 11:53:23.266] PID of FTL process: 1449
[2018-03-24 11:53:23.334] Gravity list entries: 121566
[2018-03-24 11:53:23.334] No blacklist present
[2018-03-24 11:53:23.334] No wildcard blocking list present
[2018-03-24 11:53:23.335] Database initialized
[2018-03-24 11:53:23.335] SELECT * FROM queries WHERE timestamp >= 1521802860
[2018-03-24 11:53:23.336] Imported 0 queries from the long-term database
[2018-03-24 11:53:23.336] Starting initial log file parsing
[2018-03-24 11:53:23.336] Reading from /var/log/pihole.log (rw-r--r--)
[2018-03-24 11:53:23.337] Detected restart of dnsmasq, increasing loggeneration to 1
[2018-03-24 11:53:23.338] Detected restart of dnsmasq, increasing loggeneration to 2
[2018-03-24 11:53:23.339] Detected restart of dnsmasq, increasing loggeneration to 3
[2018-03-24 11:53:23.339] Detected restart of dnsmasq, increasing loggeneration to 4
[2018-03-24 11:53:23.346] Detected restart of dnsmasq, increasing loggeneration to 5
[2018-03-24 11:53:23.347] Finished initial log file parsing
[2018-03-24 11:53:23.347]  -> Total DNS queries: 0
[2018-03-24 11:53:23.347]  -> Cached DNS queries: 0
[2018-03-24 11:53:23.347]  -> Forwarded DNS queries: 0
[2018-03-24 11:53:23.347]  -> Exactly blocked DNS queries: 0
[2018-03-24 11:53:23.347]  -> Wildcard blocked DNS queries: 0
[2018-03-24 11:53:23.347]  -> Unknown DNS queries: 0
[2018-03-24 11:53:23.347]  -> Unique domains: 0
[2018-03-24 11:53:23.347]  -> Unique clients: 0
[2018-03-24 11:53:23.347]  -> Known forward destinations: 0
[2018-03-24 11:53:23.348] Successfully accessed setupVars.conf
[2018-03-24 11:53:23.348] Listening on port 4711 for incoming IPv4 telnet connections
[2018-03-24 11:53:23.348] Found 12 IPv4 and 8 IPv6 capable interfaces
[2018-03-24 11:53:23.348] Listening on port 4711 for incoming IPv6 telnet connections
[2018-03-24 11:53:23.349] WARNING: Unable to write used port to file.

Can anyone help?

Thanks

@Sluddsy There is nothing wrong with your log…

Thanks, do you have any idea of what I may be doing wrong?

Just cannot access the web ui

If you change the port, it must reflect that in the url, for example, if you set it to port 234:

http://hassio.local:234/admin/index.php

Finally got to the ui, looks like I had the same problem as post #12. Used the local ip.

Thanks

1 Like