Browsing the FTL database

If you want to look @ the content of the pihole-FTL database, this may be an option. It requires only two (2) additional files in /var/www/html (tested on pihole v4.0)

  • download Stable version phpLiteAdmin 1.9.7.1
  • extract the zip file
  • copy phpliteadmin.config.sample.php and phpliteadmin.php into /var/www/html
  • rename phpliteadmin.config.sample.php to phpliteadmin.config.php
  • edit phpliteadmin.config.php:
    change: $directory = '.'; to $directory = '/etc/pihole';
    change: $subdirectories = false; to $subdirectories = true;

browse to http://IP address of pihole/phpliteadmin.php

Inspired by this topic, you can use the search function to list the entries for a specific client, and of course, use any valid sql query you want.

Use @ your own risk...

edit
here is a script that installs everything

#!/bin/bash

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
  echo "This script must be run as root" 1>&2
  exit 1
fi

file=phpLiteAdmin_v1-9-7-1.zip
mkdir -p phpLiteAdmin
cd phpLiteAdmin
wget https://bitbucket.org/phpliteadmin/public/downloads/$file
unzip $file

file=phpliteadmin.php
sudo mv /home/pi/phpLiteAdmin/$file /var/www/html/$file
source=phpliteadmin.config.sample.php
target=phpliteadmin.config.php
sudo mv /home/pi/phpLiteAdmin/$source /var/www/html/$target

sudo sed -i "/$directory = '.';/c\$directory = '/etc/pihole';" /var/www/html/$target
sudo sed -i '/$subdirectories = false;/c\$subdirectories = true;' /var/www/html/$target

/edit

2 Likes

While I was configuring lighttpd to use TMPFS, I noticed some error messages in /var/log/lighttpd/error.log:

(mod_fastcgi.c.2543) FastCGI-stderr: PHP Warning:  file_get_contents(/etc/pihole/list.41.someonewhocares.org.domains): failed to open stream: Permission denied in /var/www/html/phpliteadmin.php on line 769

Here is a notepad++ screenshot, with the modifications, left side is the result from the original post, right side is the corrected version, that eliminates the errors.
The downside of eliminating the errors: If pihole introduces a new database, you will NOT see it unless you update the database array.