Feedback for "Allow defining clients by their MAC address, host name and networking interface"

Updated went successfully but DNS resolution stopp without error. pihole restatdns seems to have fixed it for now.

[2020-05-18 14:24:17.304 22867] ########## FTL started! ##########
[2020-05-18 14:24:17.304 22867] FTL branch: new/mac_clients
[2020-05-18 14:24:17.304 22867] FTL version: vDev-e1c56f7
[2020-05-18 14:24:17.304 22867] FTL commit: e1c56f7
[2020-05-18 14:24:17.304 22867] FTL date: 2020-05-18 10:54:57 +0200
[2020-05-18 14:24:17.304 22867] FTL user: pihole
[2020-05-18 14:24:17.304 22867] Compiled for aarch64 (compiled on CI) using aarch64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
[2020-05-18 14:24:17.304 22867] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2020-05-18 14:24:17.304 22867]    SOCKET_LISTENING: only local
[2020-05-18 14:24:17.304 22867]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2020-05-18 14:24:17.304 22867]    MAXDBDAYS: max age for stored queries is 365 days
[2020-05-18 14:24:17.304 22867]    RESOLVE_IPV6: Resolve IPv6 addresses
[2020-05-18 14:24:17.305 22867]    RESOLVE_IPV4: Resolve IPv4 addresses
[2020-05-18 14:24:17.305 22867]    DBINTERVAL: saving to DB file every minute
[2020-05-18 14:24:17.305 22867]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2020-05-18 14:24:17.305 22867]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2020-05-18 14:24:17.305 22867]    PRIVACYLEVEL: Set to 0
[2020-05-18 14:24:17.305 22867]    IGNORE_LOCALHOST: Show queries from localhost
[2020-05-18 14:24:17.305 22867]    BLOCKINGMODE: Null IPs for blocked domains
[2020-05-18 14:24:17.305 22867]    ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2020-05-18 14:24:17.305 22867]    DBIMPORT: Importing history from database
[2020-05-18 14:24:17.305 22867]    PIDFILE: Using /var/run/pihole-FTL.pid
[2020-05-18 14:24:17.305 22867]    PORTFILE: Using /var/run/pihole-FTL.port
[2020-05-18 14:24:17.305 22867]    SOCKETFILE: Using /var/run/pihole/FTL.sock
[2020-05-18 14:24:17.305 22867]    SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2020-05-18 14:24:17.305 22867]    MACVENDORDB: Using /etc/pihole/macvendor.db
[2020-05-18 14:24:17.305 22867]    GRAVITYDB: Using /etc/pihole/gravity.db
[2020-05-18 14:24:17.306 22867]    PARSE_ARP_CACHE: Active
[2020-05-18 14:24:17.306 22867]    CNAME_DEEP_INSPECT: Active
[2020-05-18 14:24:17.306 22867]    DELAY_STARTUP: No delay requested.
[2020-05-18 14:24:17.306 22867]    BLOCK_ESNI: Enabled, blocking _esni.{blocked domain}
[2020-05-18 14:24:17.306 22867]    MAXNETAGE: Removing IP addresses and host names from network table after 24.0 hours
[2020-05-18 14:24:17.306 22867] Finished config file parsing
[2020-05-18 14:24:17.309 22867] Database version is 7
[2020-05-18 14:24:17.309 22867] Updating long-term database to version 8
[2020-05-18 14:24:17.334 22867] Database successfully initialized
[2020-05-18 14:24:17.338 22867] New upstream server: 127.0.0.1 (0/128)
[2020-05-18 14:24:17.355 22867] Resizing "/FTL-strings" from 4096 to 8192
[2020-05-18 14:24:17.391 22867] Resizing "/FTL-strings" from 8192 to 12288
[2020-05-18 14:24:17.396 22867] Resizing "/FTL-queries" from 262144 to 524288
[2020-05-18 14:24:17.426 22867] Resizing "/FTL-strings" from 12288 to 16384
[2020-05-18 14:24:17.458 22867] Resizing "/FTL-queries" from 524288 to 786432
[2020-05-18 14:24:17.502 22867] Resizing "/FTL-strings" from 16384 to 20480
[2020-05-18 14:24:17.508 22867] Resizing "/FTL-queries" from 786432 to 1048576
[2020-05-18 14:24:17.571 22867] Resizing "/FTL-strings" from 20480 to 24576
[2020-05-18 14:24:17.582 22867] Resizing "/FTL-queries" from 1048576 to 1310720
[2020-05-18 14:24:17.602 22867] Imported 17835 queries from the long-term database
[2020-05-18 14:24:17.602 22867]  -> Total DNS queries: 17835
[2020-05-18 14:24:17.602 22867]  -> Cached DNS queries: 6109
[2020-05-18 14:24:17.603 22867]  -> Forwarded DNS queries: 9405
[2020-05-18 14:24:17.603 22867]  -> Blocked DNS queries: 2318
[2020-05-18 14:24:17.603 22867]  -> Unknown DNS queries: 3
[2020-05-18 14:24:17.603 22867]  -> Unique domains: 1117
[2020-05-18 14:24:17.603 22867]  -> Unique clients: 13
[2020-05-18 14:24:17.603 22867]  -> Known forward destinations: 1
[2020-05-18 14:24:17.603 22867] Successfully accessed setupVars.conf
[2020-05-18 14:24:17.610 22869] PID of FTL process: 22869
[2020-05-18 14:24:17.610 22869] Listening on port 4711 for incoming IPv4 telnet connections
[2020-05-18 14:24:17.611 22869] Listening on port 4711 for incoming IPv6 telnet connections
[2020-05-18 14:24:17.614 22869] Listening on Unix socket
[2020-05-18 14:24:17.615 22869] Reloading DNS cache
[2020-05-18 14:24:17.615 22869] Blocking status is enabled
[2020-05-18 14:24:17.691 22869] Compiled 1 whitelist and 26 blacklist regex filters in 61.8 msec
[2020-05-18 14:24:54.137 22869] Reloading DNS cache
[2020-05-18 14:24:54.138 22869] Blocking status is enabled
[2020-05-18 14:24:54.671 22869] SQLite3 message: file unlinked while open: /etc/pihole/gravity.db (28)
[2020-05-18 14:24:54.750 22869] Compiled 1 whitelist and 26 blacklist regex filters in 52.4 msec
[2020-05-18 14:24:54.778 22869] Shutting down...
[2020-05-18 14:24:54.813 22869] Finished final database update
[2020-05-18 14:24:54.815 22869] ########## FTL terminated after 3.751146e+01 s! ##########
[2020-05-18 14:24:56.149 23339] Using log file /var/log/pihole-FTL.log
[2020-05-18 14:24:56.149 23339] ########## FTL started! ##########
[2020-05-18 14:24:56.150 23339] FTL branch: new/mac_clients
[2020-05-18 14:24:56.150 23339] FTL version: vDev-e1c56f7
[2020-05-18 14:24:56.150 23339] FTL commit: e1c56f7
[2020-05-18 14:24:56.150 23339] FTL date: 2020-05-18 10:54:57 +0200
[2020-05-18 14:24:56.150 23339] FTL user: pihole
[2020-05-18 14:24:56.150 23339] Compiled for aarch64 (compiled on CI) using aarch64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
[2020-05-18 14:24:56.150 23339] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2020-05-18 14:24:56.150 23339]    SOCKET_LISTENING: only local
[2020-05-18 14:24:56.150 23339]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2020-05-18 14:24:56.150 23339]    MAXDBDAYS: max age for stored queries is 365 days
[2020-05-18 14:24:56.150 23339]    RESOLVE_IPV6: Resolve IPv6 addresses
[2020-05-18 14:24:56.150 23339]    RESOLVE_IPV4: Resolve IPv4 addresses
[2020-05-18 14:24:56.150 23339]    DBINTERVAL: saving to DB file every minute
[2020-05-18 14:24:56.150 23339]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2020-05-18 14:24:56.150 23339]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2020-05-18 14:24:56.150 23339]    PRIVACYLEVEL: Set to 0
[2020-05-18 14:24:56.151 23339]    IGNORE_LOCALHOST: Show queries from localhost
[2020-05-18 14:24:56.151 23339]    BLOCKINGMODE: Null IPs for blocked domains
[2020-05-18 14:24:56.151 23339]    ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2020-05-18 14:24:56.151 23339]    DBIMPORT: Importing history from database
[2020-05-18 14:24:56.151 23339]    PIDFILE: Using /var/run/pihole-FTL.pid
[2020-05-18 14:24:56.151 23339]    PORTFILE: Using /var/run/pihole-FTL.port
[2020-05-18 14:24:56.151 23339]    SOCKETFILE: Using /var/run/pihole/FTL.sock
[2020-05-18 14:24:56.151 23339]    SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2020-05-18 14:24:56.151 23339]    MACVENDORDB: Using /etc/pihole/macvendor.db
[2020-05-18 14:24:56.151 23339]    GRAVITYDB: Using /etc/pihole/gravity.db
[2020-05-18 14:24:56.151 23339]    PARSE_ARP_CACHE: Active
[2020-05-18 14:24:56.151 23339]    CNAME_DEEP_INSPECT: Active
[2020-05-18 14:24:56.151 23339]    DELAY_STARTUP: No delay requested.
[2020-05-18 14:24:56.151 23339]    BLOCK_ESNI: Enabled, blocking _esni.{blocked domain}
[2020-05-18 14:24:56.152 23339]    MAXNETAGE: Removing IP addresses and host names from network table after 24.0 hours
[2020-05-18 14:24:56.152 23339] Finished config file parsing
[2020-05-18 14:24:56.154 23339] Database version is 8
[2020-05-18 14:24:56.154 23339] Database successfully initialized
[2020-05-18 14:24:56.155 23339] New upstream server: 127.0.0.1 (0/128)
[2020-05-18 14:24:56.169 23339] Resizing "/FTL-strings" from 4096 to 8192
[2020-05-18 14:24:56.198 23339] Resizing "/FTL-strings" from 8192 to 12288
[2020-05-18 14:24:56.203 23339] Resizing "/FTL-queries" from 262144 to 524288
[2020-05-18 14:24:56.237 23339] Resizing "/FTL-strings" from 12288 to 16384
[2020-05-18 14:24:56.271 23339] Resizing "/FTL-queries" from 524288 to 786432
[2020-05-18 14:24:56.316 23339] Resizing "/FTL-strings" from 16384 to 20480
[2020-05-18 14:24:56.321 23339] Resizing "/FTL-queries" from 786432 to 1048576
[2020-05-18 14:24:56.385 23339] Resizing "/FTL-strings" from 20480 to 24576
[2020-05-18 14:24:56.397 23339] Resizing "/FTL-queries" from 1048576 to 1310720
[2020-05-18 14:24:56.417 23339] Imported 17880 queries from the long-term database
[2020-05-18 14:24:56.418 23339]  -> Total DNS queries: 17880
[2020-05-18 14:24:56.418 23339]  -> Cached DNS queries: 6135
[2020-05-18 14:24:56.418 23339]  -> Forwarded DNS queries: 9424
[2020-05-18 14:24:56.418 23339]  -> Blocked DNS queries: 2318
[2020-05-18 14:24:56.418 23339]  -> Unknown DNS queries: 3
[2020-05-18 14:24:56.419 23339]  -> Unique domains: 1117
[2020-05-18 14:24:56.419 23339]  -> Unique clients: 13
[2020-05-18 14:24:56.419 23339]  -> Known forward destinations: 1
[2020-05-18 14:24:56.419 23339] Successfully accessed setupVars.conf
[2020-05-18 14:24:56.425 23341] PID of FTL process: 23341
[2020-05-18 14:24:56.426 23341] Listening on port 4711 for incoming IPv4 telnet connections
[2020-05-18 14:24:56.426 23341] Listening on port 4711 for incoming IPv6 telnet connections
[2020-05-18 14:24:56.426 23341] Listening on Unix socket
[2020-05-18 14:24:56.428 23341] Reloading DNS cache
[2020-05-18 14:24:56.428 23341] Blocking status is enabled
[2020-05-18 14:24:56.498 23341] Compiled 1 whitelist and 26 blacklist regex filters in 54.2 msec
[2020-05-18 14:37:48.579 23916] Using log file /var/log/pihole-FTL.log
[2020-05-18 14:37:48.579 23916] ########## FTL started! ##########
[2020-05-18 14:37:48.579 23916] FTL branch: new/mac_clients
[2020-05-18 14:37:48.579 23916] FTL version: vDev-e1c56f7
[2020-05-18 14:37:48.579 23916] FTL commit: e1c56f7
[2020-05-18 14:37:48.579 23916] FTL date: 2020-05-18 10:54:57 +0200
[2020-05-18 14:24:54.671 22869] SQLite3 message: file unlinked while open: /etc/pihole/gravity.db (28)

This always happens during gravity runs and isn't something to worry about.

Hmm... let's monitor this.

Bildschirmfoto zu 2020-05-18 16-33-48

Fixed.


As you said, some things with Network table might not work: Sorting by IP is one of those things.

All empty?


I thought network table and GM-> clients used to display "names" I've set in Local DNS records. But now they are "unknown"/not displayed.

Is this still the case?
The network table had to be reset as we're now explicitly linking host names to IP addresses and this data was not available from the existing data. However, the host names should be re-populated rather soon (at least for clients known to FTL). I will work on getting host names for clients not directing queries at FTL. However, this is more lower priority as it is just the icing on the cake whereas it will not be trivial to add this concerning all the datalocks which need to be carefully aligned for this.

Furthermore, we remove records which are older than 24 hours (we flag them as "expired"). Do you think this is bad/needs tweaking?
You can customize the time after which IP addresses and host names are removed through pihole-FTL.conf using MAXNETAGE=24.0 to specify 24 hours. You can also set 72.0 for three days, etc.

Fixed.

I also changed the debug flag you have to set to true from DEBUG_DATABASE=true to DEBUG_CLIENTS=true. This will be a lot less chattier as you're likely not interested in the remaining database noise. I edited my post above to show this new flag.

Flushed network table, two device still unknown (no hostname) despite Local DNS Record in network table. No hostname in GM->clients.

Without queries

And one with queries


I think this is a good starting point. 24h is a common lease time.


Flushing network table was successful but gave an error.

There was a problem applying your settings.
Debugging information:
PHP error (2): implode(): Invalid arguments passed in /var/www/html/admin/scripts/pi-hole/php/savesettings.php:728

Table header needs to be adjusted. Maybe simply "Client"
Bildschirmfoto zu 2020-05-18 22-36-14


Played with the hostname input. I know you implemented a basic filter, but adding // crashed FTL.

[2020-05-18 22:50:52.821 14762] Querying gravity database for client with IP 10.0.99.192...
[2020-05-18 22:50:52.821 14762] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-05-18 22:50:52.821 14762] ---------------------------->  FTL crashed!  <----------------------------
[2020-05-18 22:50:52.821 14762] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-05-18 22:50:52.821 14762] Please report a bug at https://github.com/pi-hole/FTL/issues
[2020-05-18 22:50:52.822 14762] and include in your report already the following details:
[2020-05-18 22:50:52.822 14762] FTL has been running for 150 seconds
[2020-05-18 22:50:52.822 14762] FTL branch: new/mac_clients
[2020-05-18 22:50:52.822 14762] FTL version: vDev-9dd8ed7
[2020-05-18 22:50:52.822 14762] FTL commit: 9dd8ed7
[2020-05-18 22:50:52.822 14762] FTL date: 2020-05-18 21:05:28 +0200
[2020-05-18 22:50:52.822 14762] FTL user: started as pihole, ended as pihole
[2020-05-18 22:50:52.822 14762] Compiled for aarch64 (compiled on CI) using aarch64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
[2020-05-18 22:50:52.822 14762] Received signal: Segmentation fault
[2020-05-18 22:50:52.822 14762]      at address: (nil)
[2020-05-18 22:50:52.822 14762]      with code: SEGV_MAPERR (Address not mapped to object)
[2020-05-18 22:50:52.825 14762] Backtrace:
[2020-05-18 22:50:52.826 14762] B[0000]: 0xaaaadd88a324, /usr/bin/pihole-FTL(+0x36324) [0xaaaadd88a324]
[2020-05-18 22:50:52.826 14762] B[0001]: 0xffff8f2055b8, linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xffff8f2055b8]
[2020-05-18 22:50:52.826 14762] B[0002]: 0xffff8f099710, /lib/aarch64-linux-gnu/libc.so.6(strlen+0x10) [0xffff8f099710]
[2020-05-18 22:50:52.826 14762] B[0003]: 0xffff8f10badc, /lib/aarch64-linux-gnu/libc.so.6(inet_pton+0x1c) [0xffff8f10badc]
[2020-05-18 22:50:52.826 14762] B[0004]: 0xaaaadd8835a4, /usr/bin/pihole-FTL(+0x2f5a4) [0xaaaadd8835a4]
[2020-05-18 22:50:52.826 14762] B[0005]: 0xaaaadd96d2e8, /usr/bin/pihole-FTL(+0x1192e8) [0xaaaadd96d2e8]
[2020-05-18 22:50:52.826 14762] B[0006]: 0xaaaadd975ca4, /usr/bin/pihole-FTL(+0x121ca4) [0xaaaadd975ca4]
[2020-05-18 22:50:52.827 14762] B[0007]: 0xaaaadd880a60, /usr/bin/pihole-FTL(+0x2ca60) [0xaaaadd880a60]
[2020-05-18 22:50:52.827 14762] B[0008]: 0xaaaadd882d74, /usr/bin/pihole-FTL(gravityDB_get_regex_client_groups+0x27c) [0xaaaadd882d74]
[2020-05-18 22:50:52.827 14762] B[0009]: 0xaaaadd892724, /usr/bin/pihole-FTL(read_regex_from_database+0x74c) [0xaaaadd892724]
[2020-05-18 22:50:52.827 14762] B[0010]: 0xaaaadd88a118, /usr/bin/pihole-FTL(FTL_reload_all_domainlists+0x40) [0xaaaadd88a118]
[2020-05-18 22:50:52.827 14762] B[0011]: 0xffff8f2055b8, linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xffff8f2055b8]
[2020-05-18 22:50:52.827 14762] B[0012]: 0xffff8f0e42f4, /lib/aarch64-linux-gnu/libc.so.6(__poll+0xec) [0xffff8f0e42f4]
[2020-05-18 22:50:52.827 14762] B[0013]: 0xaaaadd8bc51c, /usr/bin/pihole-FTL(main_dnsmasq+0xd8c) [0xaaaadd8bc51c]
[2020-05-18 22:50:52.827 14762] B[0014]: 0xaaaadd87bf30, /usr/bin/pihole-FTL(main+0xf0) [0xaaaadd87bf30]
[2020-05-18 22:50:52.827 14762] B[0015]: 0xffff8f03ed24, /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe4) [0xffff8f03ed24]
[2020-05-18 22:50:52.827 14762] B[0016]: 0xaaaadd87c0c4, /usr/bin/pihole-FTL(+0x280c4) [0xaaaadd87c0c4]
[2020-05-18 22:50:52.827 14762] ------ Listing content of directory /dev/shm ------
[2020-05-18 22:50:52.827 14762] File Mode User:Group  Filesize Filename
[2020-05-18 22:50:52.828 14762] rwxrwxrwx root:root 260 .
[2020-05-18 22:50:52.828 14762] rwxr-xr-x root:root 3K ..
[2020-05-18 22:50:52.828 14762] rw------- pihole:pihole 4K FTL-per-client-regex
[2020-05-18 22:50:52.828 14762] rw------- pihole:pihole 4K FTL-dns-cache
[2020-05-18 22:50:52.828 14762] rw------- pihole:pihole 12K FTL-overTime
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 1M FTL-queries
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 4K FTL-upstreams
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 332K FTL-clients
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 98K FTL-domains
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 29K FTL-strings
[2020-05-18 22:50:52.829 14762] rw------- pihole:pihole 12 FTL-settings
[2020-05-18 22:50:52.830 14762] rw------- pihole:pihole 124 FTL-counters
[2020-05-18 22:50:52.830 14762] rw------- pihole:pihole 56 FTL-lock
[2020-05-18 22:50:52.830 14762] ---------------------------------------------------
[2020-05-18 22:50:52.830 14762] Thank you for helping us to improve our FTL engine!
[2020-05-18 22:50:52.830 14762] FTL terminated!
[2020-05-18 22:51:15.731 14955] Using log file /var/log/pihole-FTL.log
[2020-05-18 22:51:15.731 14955] ########## FTL started! ##########

Hmm, that doesn't seem to work:

pi@pihole:~ $ pihole checkout development
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [i] Requested option "development" is not available

run pihole checkout dev not development

Ah, I was missing core, run

pihole checkout core dev

or run what @technicalpyro suggested but you'll need to re-checkout web and FTL afterwards, so the first command is preferred.

Well, interesting, this killed the system-provided function inet_pton. I was expecting this to be robust against invalid input but this doesn't seem to hold true. I will implement a check for IP addresses before calling this kernel function. You triggered an edge-case with an empty CIDR. Thanks for trying exactly this. It is now fixed. Please try further things to break it :slight_smile:

The idea is to do two things:

  1. Try to obtain a host name for clients newly added to the table which are unknown to FTL
  2. Re-resolve all host names from all addresses once an hour.

No. 2 wasn't working because I wrapped everything into a single transaction and forgot to actually commit the changes to the database. This is now fixed as well. Please see if they populate after some time (as said, it may take up to the next full hour).


Interesting, I pushed a potential fix for this.

Yes. I also added a tooltip hint.

I just tried this myself and it worked. I added

and FTL added at 12:00 the following appeared

(the host name was unknown before)

1 Like

Can confirm. Took some time, but now I see all names for clients where Local DNS Records exist.

What I get now might be normal debug output.

[2020-05-19 19:00:00.677 17215] Res: no more rows available
[2020-05-19 19:00:00.678 17215] Res: no more rows available
[2020-05-19 19:00:00.679 17215] Res: no more rows available
[2020-05-19 19:00:00.679 17215] Res: no more rows available
[2020-05-19 19:00:00.680 17215] Res: no more rows available
[2020-05-19 19:00:00.681 17215] Res: no more rows available
[2020-05-19 19:00:00.682 17215] Res: no more rows available
[2020-05-19 19:00:00.683 17215] Res: no more rows available
[2020-05-19 19:00:00.684 17215] Res: no more rows available
[2020-05-19 19:00:00.685 17215] Res: no more rows available
[2020-05-19 19:00:00.688 17215] Res: no more rows available
[2020-05-19 19:00:00.689 17215] Res: no more rows available
[2020-05-19 19:00:00.690 17215] Res: no more rows available
[2020-05-19 19:00:00.691 17215] Res: no more rows available
[2020-05-19 19:00:00.692 17215] Res: no more rows available
[2020-05-19 19:00:00.693 17215] Res: no more rows available

Might be enough to print it once?

Fixed for me.

I'll try, but you made it difficult.

This was debugging output that should not be there anymore at all. I removed it.

Just wanted to confirm that all hostnames are now listed with the most recent update.

2 posts were split to a new topic: Hostnames in IPv6-only environment

Some 300 lines of code later...

You should now also see interface names being populated for devices added to the network table for devices more than one hop away. There are three restrictions for when they can be obtained:

  1. The said device has do at least one query after you update to the most recent FTL
  2. The query must be made over UDP (interface information isn't available for TCP queries at the moment)
  3. You may not use the option bind-interfaces.

I'll put some more thoughts in relaxing 2 & 3, however, getting the interface for them is way trickier than one would have thought.

edit Restriction no. 2 is solved, no. 3 will likely stay.


Example from my network table:

Things worth noting here:

  • 192.168.4.3 is my phone connected through Wireguard. We get both the interface as well as the host name. The latter is defined through local DNS records. It shows the interface wg0 as my config file is /etc/wireguard/wg0.conf. If you'd name your wireguard interface differently, then you may see other things here (like home or work).
    Note: For OpenVPN connections you'd see tun0 etc.
  • We also get interface and host name of 127.0.0.1.
  • The third device actually exists physically. Its record was complete even before my changes.

I know, I can already hear it ... Client selection by interface...

There we go, per-Interface is now supported as well. To keep interface names separate from host names, we will prepend interface names with a colon like :eth0 in order to rule out accidental matches.

The client column does now support the following for client selection:

Type Example
IP address 192.168.2.12
IP subnet 192.168.2.0/24
MAC address AA:BB:CC:DD:EE:FF
host name localhost
interface :eth0

edit The first match (from top to bottom) will be used to define the groups of a client.

I think we're on a good way here and definitely need more testing of all the new possibilities.

Your pace is awesome. Soon there will be no features left to be implemented....

It get fairly complicated with all the possibilities now. What is the order clients will be assigned? IP, MAC, Hostname, Interface. The moment one property fits all the others are skipped? Although the explanation is long already this might be worth putting there.

What is missing now is the "interface" in the explanation and tooltip hint.

And the "warning" only says "IP" and "MAC".

I can already here it... support wildcards......and vendor

So I have a device connected from a different source using Pihole as dns server on a VPN. I assume I would probably see my interface as eth0 since the interface is not directly connected to the pi.

Same for me. My VPN endpoint is my router and routes the DNS traffic to pihole. Devices appear as eth0.

Yes. The table I put from top to bottom. The first hit counts. IP is more important than MAC address which is more important than hostname which is more important than interface.

Yeah, I did not update the web interface at all for this. Still do be done.

  • wildcards: Already implemented with IP/CIDR. I don't think wildcards will be needed for MACs, host names or interfaces.
  • vendor: Why would I add rules for a specific vendor to be blocked? I see no reasoning here. If you want to block specific, e.g., Samsung domains to prevent Samsung devices from talking home ... you should probably just block them for all devices.

edit I think what I added in here can be very useful. If we go ahead and allow more and more, then users will use it even when they should not. Because a lot of users tend to overcomplicate things when there is no need to. It takes a lot of experience to see the simple solution, sometimes.
I will edit the priority into my table above.

Another, rather small update to this experimental branch: As the ip address is a UNIQUE field in the network_addresses table, new assignments of a previously seen IP address will automatically move an already known old address to the new device. This makes removing old entries somewhat less important. However, the new possibility to specify clients by host names may make it more important to be able to remember devices not seen for longer so they can get recognized sooner.

Hence, we disable the automated removal for now, but leave the FTL config option MAXNETAGE so users can re-enable this if they feel a need for it (setting it to a positive value will re-enable automatic removal of entries).

We'll have to see how this goes.

Automated rescanning of client groups a certain time after their first query (if their host names are only known a few minutes later, etc.) is still a to-do.