Skip to content

Pi-hole Quick Reference Commands

All commands listed are intended to be entered via the console or terminal.

Allow/Deny

Task Command Example Notes Link
Allow Domain pihole --white-wild example.com Add domain and all subdomains to allowed domains.
Allow Domain pihole -w example.com Add domain to allowed domains.
Allow Domain pihole whitelist example.com Add domain to allowed domains.
Allow Domains pihole -w example.com example.org Add multiple domains to allowed domains.
Allow Domain Regex pihole --white-regex '^example.com$' Add a domain using regular expressions to allowed domains. RegEx
Allow Domains Regex pihole --white-regex '^example.com$' '.*\.example.net' Add multiple domains using regular expressions to allowed domains. RegEx
Deny Domain pihole --wild example.com Add domain and all subdomains to denied domains.
Deny Domain pihole -b example.com Add domain to denied domains.
Deny Domain pihole blacklist example.com Add domain to denied domains.
Deny Domain pihole wildcard example.com Add domain and all subdomains to denied domains.
Deny Domains pihole -b example.com example.org Add multiple domains to denied domains.
Deny Domain Regex pihole --regex '^example.com$' Add a domain using regular expressions to denied domains. RegEx
Deny Domain Regex pihole regex '^example.com$' Add a domain using regular expressions to denied domains. RegEx
Deny Domains Regex pihole --regex '^example.com$' '.*\.example.net' Add multiple domains using regular expressions to denied domains. RegEx
List Allowed Domains pihole -w -l Display a list all allowed domains.
List Denied Domains pihole -b -l Display a list all denied domains.
Remove Allowed Domain pihole -w -d example.com Remove domain from allowed domains.
Remove Denied Domain pihole -b -d example.com Remove domain from denied domains.

Administration

Task Command Example Notes
Backup Config pihole -a -t pihole-config-2022-03-03.tar.gz Backup configuration to a specified archive name in the current working directory.
Backup Config pihole -a -t Backup configuration to an archive in the current working directory (e.g. pi-hole-alarmpi-teleporter_2022-03-03_18-04-06.tar.gz).
Backup Config pihole admin teleporter Backup configuration to an archive in the current working directory (e.g. pi-hole-alarmpi-teleporter_2022-03-03_18-04-06.tar.gz).
Clear Logs pihole -f Empty or rotate log file located at /var/log/pihole.log. Will rotate log if logrotate is installed.
Clear Logs pihole flush Empty or rotate log file located at /var/log/pihole.log. Will rotate log if logrotate is installed.
Clear Network Tables pihole arpflush Remove information stored in Pi-hole's network tables.
Debug Mode pihole -d Start a debugging session.
Debug Mode pihole debug Start a debugging session.
Disable Services pihole disable 5m Disable all services for 5 minutes.
Disable Services pihole disable 600s Disable all services for 600 seconds.
Disable Services pihole disable Disable all services.
Enable Services pihole enable Start all services.
Restart DNS pihole restartdns reload-lists Update the lists without flushing cache and restarting the DNS server.
Restart DNS pihole restartdns reload Update the lists and flush cache without restarting the DNS server.
Restart DNS pihole restartdns Restart all Pi-hole services.
Search Adlist pihole -q -all example.com Query the adlists for any reference of specified domain or keyword.
Search Adlist pihole -q -exact example.com Query the adlists for exactly specified domain or keyword.
Search Adlist pihole -q example.com Query the adlists for any reference of specified domain or keyword.
Search Adlist pihole query example.com Query the adlists for a specified domain or keyword.
Status pihole status Display the current status of all Pi-hole services.
Update Gravity pihole -g Update the list of ad-serving domains in adlists.list.
Update Gravity pihole updateGravity Update the list of ad-serving domains in adlists.list.
Update Pi-hole pihole -up Check for updates and if updates automatically update/reinstall.
Update Pi-hole pihole updatePihole Check for updates and if updates automatically update/reinstall.
View Logs pihole -t blocked View log output live with a filter.
View Logs pihole -t View log output live without a filter.
View Logs pihole tail blocked View log output live with a filter.
View Logs pihole tail View log output live without a filter.

Configuration

Task Command Example Notes Link
Change Branch pihole checkout dev Switch Pi-hole to a different GitHub branch or repository.
Disable Log pihole -l off noflush Disable logging and do not empty log entries in /var/log/pihole.log.
Disable Log pihole -l off Disable and empty log entries in /var/log/pihole.log.
Enable Log pihole -l on Enable logging to /var/log/pihole.log.
Enable Log pihole logging on Enable logging to /var/log/pihole.log.
Reconfigure pihole reconfigure Runs through the first-time installation prompts. Retains existing settings and will attempt to repair scripts or dependencies as necessary.
Remove Email Address pihole -a -e Remove administrator contact email address for the block page.
Remove Email Address pihole admin email Remove administrator contact email address for the block page.
Set Celsius pihole -a -c Set temperature unit format to celsius.
Set Celsius pihole admin celsius Set temperature unit format to celsius.
Set Dnsmasq Interface pihole -a -i all Specify dnsmasq's interface listening behavior. Listen on all interfaces, permit all origins. Interface binding behavior
Set Dnsmasq Interface pihole -a -i bind Specify dnsmasq's interface listening behavior. Bind only on interface eth0. Interface binding behavior
Set Dnsmasq Interface pihole -a -i local Specify dnsmasq's interface listening behavior. Only respond to queries from devices that are at most one hop away (local devices). Interface binding behavior
Set Dnsmasq Interface pihole -a -i single Specify dnsmasq's interface listening behavior. Only respond to interface eth0. Interface binding behavior
Set Dnsmasq Interface pihole admin interface local Specify dnsmasq's interface listening behavior. Only respond to queries from devices that are at most one hop away (local devices). Interface binding behavior
Set Email Address pihole -a -e admin@example.com Set administrator contact email address for the block page.
Set Email Address pihole admin email admin@example.com Set administrator contact email address for the block page.
Set Fahrenheit pihole -a -f Set temperature unit format to fahrenheit.
Set Fahrenheit pihole admin fahrenheit Set temperature unit format to fahrenheit.
Set Kelvin pihole -a -k Set temperature unit format to kelvin.
Set Kelvin pihole admin kelvin Set temperature unit format to kelvin.
Set Password pihole -a -p Set the admin console (web interface) password.
Set Password pihole admin password Set the admin (web interface) console password.
Set Privacy Level pihole -a -l 0 Specify the privacy level to use. Defaults to 0 if not set. Privacy Levels
Uninstall pihole uninstall Uninstall Pi-hole from your system, giving the option to remove each dependency individually.

System Information

Task Command Example Notes Link
View Help pihole --help Display the command line help.
View Help pihole -h Display the command line help.
View Help pihole help Display the command line help.
View Stats pihole -c -e Display statistics and general information then immediate exit without refreshing.
View Stats pihole -c -j Output statistics in a JSON formatted string.
View Stats pihole -c -r 300 Display statistics and general information with a specified update frequency of 300 seconds.
View Stats pihole -c Display statistics and general information. Press CTRL+C to exit.
View Stats pihole chronometer Display statistics and general information. Press CTRL+C to exit. Chronometer
View Version pihole -v --hash Display GitHub hash from your local repository.
View Version pihole -v -a Display AdminLTE version from repository.
View Version pihole -v -c Display all current versions.
View Version pihole -v -f Display FTL version from repository.
View Version pihole -v -l Display all latest versions.
View Version pihole -v -p Display Pi-hole version from repository.
View Version pihole -v Display the version of each service.
View Version pihole version Display the version of each service.

Arch Linux Arm Missing Commands

The following commands are not available on Arch Linux Arm when installed as a AUR package following the article, Arch Linux ARM Install Pi-Hole On A Raspberry Pi.

  • pihole -d
  • pihole -up
  • pihole checkout
  • pihole debug
  • pihole enable
  • pihole reconfigure
  • pihole uninstall
  • pihole updatePihole

Last update: April 7, 2022