mirror of
https://github.com/pi-hole/docs.git
synced 2026-02-15 07:26:03 +00:00
Fix markdownlinting errors
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -5,51 +5,50 @@ title: The pihole command - Pi-hole documentation
|
||||
Pi-hole makes use of many commands, and here we will break down those required to administer the program via the command-line Interface.
|
||||
|
||||
| Index | Invocation |
|
||||
-------------- | --------------
|
||||
[Core Script](#pi-hole-core) | `pihole`
|
||||
| -------------- | -------------- |
|
||||
| [Core Script](#pi-hole-core) | `pihole` |
|
||||
|
||||
---
|
||||
|
||||
## Pi-hole Core
|
||||
|
||||
| Feature | Invocation |
|
||||
-------------- | --------------
|
||||
[Core](#core-script) | `pihole`
|
||||
[Whitelisting, Blacklisting and Regex](#whitelisting-blacklisting-and-regex) | `pihole -w`, `pihole -b`, `pihole --regex`, `pihole --wild`
|
||||
[Debugger](#debugger) | `pihole debug`
|
||||
[Log Flush](#log-flush) | `pihole flush`
|
||||
[Reconfigure](#reconfigure) | `pihole reconfigure`
|
||||
[Tail](#tail) | `pihole tail`
|
||||
[Set password](#password) | `pihole setpassword`
|
||||
[Chronometer](#chronometer) | `pihole chronometer`
|
||||
[Gravity](#gravity) | `pihole updateGravity`
|
||||
[Logging](#logging) | `pihole logging`
|
||||
[Query](#query) | `pihole query`
|
||||
[Update](#update) | `pihole updatePihole`
|
||||
[Version](#version) | `pihole version`
|
||||
[Uninstall](#uninstall) | `pihole uninstall`
|
||||
[Status](#status) | `pihole status`
|
||||
[Enable & Disable](#enable-&-disable) | `pihole enable` <!-- markdownlint-disable-line MD051 -->
|
||||
[Restart DNS](#restart-dns) | `pihole restartdns`
|
||||
[Checkout](#checkout) | `pihole checkout`
|
||||
| Feature | Invocation |
|
||||
| -------------- | -------------- |
|
||||
| [Core](#core-script) | `pihole` |
|
||||
| [Whitelisting, Blacklisting and Regex](#whitelisting-blacklisting-and-regex) | `pihole -w`, `pihole -b`, `pihole --regex`, `pihole --wild` |
|
||||
| [Debugger](#debugger) | `pihole debug` |
|
||||
| [Log Flush](#log-flush) | `pihole flush` |
|
||||
| [Reconfigure](#reconfigure) | `pihole reconfigure` |
|
||||
| [Tail](#tail) | `pihole tail` |
|
||||
| [Set password](#password) | `pihole setpassword` |
|
||||
| [Gravity](#gravity) | `pihole updateGravity` |
|
||||
| [Logging](#logging) | `pihole logging` |
|
||||
| [Query](#query) | `pihole query` |
|
||||
| [Update](#update) | `pihole updatePihole` |
|
||||
| [Version](#version) | `pihole version` |
|
||||
| [Uninstall](#uninstall) | `pihole uninstall` |
|
||||
| [Status](#status) | `pihole status` |
|
||||
| [Enable & Disable](#enable-&-disable) | `pihole enable` <!-- markdownlint-disable-line MD051 --> |
|
||||
| [Restart DNS](#restart-dns) | `pihole restartdns` |
|
||||
| [Checkout](#checkout) | `pihole checkout` |
|
||||
|
||||
### Core Script
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole --help`
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | `pihole -b advertiser.example.com`
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole --help` |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | `pihole -b advertiser.example.com` |
|
||||
|
||||
The core script of Pi-hole provides the ability to tie many DNS related functions into a simple and user-friendly management system, so that one may easily block unwanted content such as advertisements. For both the Command-line Interface (CLI) and Web Interface, we achieve this through the `pihole` command (this helps minimize code duplication, and allows users to read exactly what's happening using `bash` scripting). This "wrapper" elevates the current user (whether it be your own user account, or `www-data`) using `sudo`, but restricts the elevation to solely what can be called through the wrapper.
|
||||
|
||||
### Whitelisting, Blacklisting and Regex
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole -w --help`, `pihole -b --help`, `pihole --regex --help`, `pihole --wild --help`
|
||||
Script Location | [`/opt/pihole/list.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/list.sh)
|
||||
Example Usage | [`pihole --regex '^example.com$' '.*\.example2.net'`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#white-black-list)
|
||||
| | |
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole -w --help`, `pihole -b --help`, `pihole --regex --help`, `pihole --wild --help` |
|
||||
| Script Location | [`/opt/pihole/list.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/list.sh) |
|
||||
| Example Usage | [`pihole --regex '^example.com$' '.*\.example2.net'`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#white-black-list) |
|
||||
|
||||
Administrators need to be able to manually add and remove domains for various purposes, and these commands serve that purpose.
|
||||
|
||||
@@ -64,30 +63,30 @@ See [Regex Blocking](../regex/overview.md) for more information about using Rege
|
||||
### Debugger
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/opt/pihole/piholeDebug.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeDebug.sh)
|
||||
Example Usage | [`pihole debug`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#debug)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/opt/pihole/piholeDebug.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeDebug.sh) |
|
||||
| Example Usage | [`pihole debug`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#debug) |
|
||||
|
||||
The Pi-hole debugger will attempt to diagnose any issues, and link to an FAQ with instructions as to how an admin can rectify the issue. Once the debugger has finished, the admin has the option to upload the generated log to the Pi-hole developers, who can help with diagnosing and rectifying persistent issues.
|
||||
|
||||
### Log Flush
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/opt/pihole/piholeLogFlush.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeLogFlush.sh)
|
||||
Example Usage | [`pihole flush`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#flushing-the-log)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/opt/pihole/piholeLogFlush.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeLogFlush.sh) |
|
||||
| Example Usage | [`pihole flush`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#flushing-the-log) |
|
||||
|
||||
When invoked manually, this command will allow you to empty Pi-hole's log, which is located at `/var/log/pihole/pihole.log`. The command also serves to rotate the log daily, if the `logrotate` application is installed.
|
||||
|
||||
### Reconfigure
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/etc/.pihole/automated install/basic-install.sh`](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh)
|
||||
Example Usage | `pihole reconfigure`
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/etc/.pihole/automated install/basic-install.sh`](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh) |
|
||||
| Example Usage | `pihole reconfigure` |
|
||||
|
||||
There are times where the administrator will need to repair or reconfigure the Pi-hole installation, which is performed via this command.
|
||||
|
||||
@@ -101,39 +100,20 @@ There are times where the administrator will need to repair or reconfigure the P
|
||||
### Tail
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole tail`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#tailing-the-log)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole tail`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#tailing-the-log) |
|
||||
|
||||
Since Pi-hole will log DNS queries by default, using this command to watch the log in real-time can be useful for debugging a problematic site, or even just for sheer curiosities sake.
|
||||
|
||||
|
||||
### Chronometer
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole -c --help`
|
||||
Script Location | [`/opt/pihole/chronometer.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/chronometer.sh)
|
||||
Example Usage | [`pihole -c -e`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#chronometer)
|
||||
|
||||
Chronometer is a console dashboard of real-time stats, which can be displayed via `ssh` or on an LCD screen attached directly to your hardware. The script is capable of detecting the size of your screen and adjusting output to try and best suit it.
|
||||
|
||||
<a href="../chronometer.jpg">
|
||||
<img srcset="../chronometer-thumb.jpg, ../chronometer-thumb@2x.jpg 2x" src="../chronometer-thumb.jpg" alt="Chronometer in action" width="450" height="600">
|
||||
</a>
|
||||
<br/>
|
||||
<sub>
|
||||
<a href="https://www.reddit.com/r/pihole/comments/6ldjna/pihole_setup_went_so_well_at_home_for_the_1st/">Image courtesy of /u/super_nicktendo22</a>
|
||||
</sub>
|
||||
|
||||
### Gravity
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/opt/pihole/gravity.sh`](https://github.com/pi-hole/pi-hole/blob/master/gravity.sh)
|
||||
Example Usage | [`pihole -g`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#gravity)
|
||||
| | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/opt/pihole/gravity.sh`](https://github.com/pi-hole/pi-hole/blob/master/gravity.sh) |
|
||||
| Example Usage | [`pihole -g`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#gravity) |
|
||||
|
||||
Gravity is one of the most important scripts of Pi-hole. Its main purpose is to retrieve blocklists, and then consolidate them into one unique list for the built-in DNS server to use, but it also serves to complete the process of manual whitelisting, blacklisting and wildcard update. It is run automatically each week, but it can be invoked manually at any time.
|
||||
|
||||
@@ -150,20 +130,20 @@ Gravity is one of the most important scripts of Pi-hole. Its main purpose is to
|
||||
### Logging
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole logging --help`
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole logging off`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#logging)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole logging --help` |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole logging off`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#logging) |
|
||||
|
||||
This command specifies whether the Pi-hole log should be used, by commenting out `log-queries` within `/etc/dnsmasq.d/01-pihole.conf` and flushing the log.
|
||||
|
||||
### Query
|
||||
|
||||
| | |
|
||||
--------------- | ---------------
|
||||
Help Command | `pihole query --help`
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole -q -exact -adlist example.domain.com`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#adlist-query)
|
||||
| --------------- | --------------- |
|
||||
| Help Command | `pihole query --help` |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole -q -exact -adlist example.domain.com`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#adlist-query) |
|
||||
|
||||
This command will query your whitelist, blacklist, wildcards and adlists for a specified domain.
|
||||
|
||||
@@ -176,10 +156,10 @@ This command will query your whitelist, blacklist, wildcards and adlists for a s
|
||||
### Update
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole updatePihole`
|
||||
Script Location | [`/opt/pihole/update.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/update.sh)
|
||||
Example Usage | `pihole -up`
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole updatePihole` |
|
||||
| Script Location | [`/opt/pihole/update.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/update.sh) |
|
||||
| Example Usage | `pihole -up` |
|
||||
|
||||
Check Pi-hole Core, Web Interface and FTL repositories to determine what upgrades (if any) are required. It will then automatically update and reinstall if necessary.
|
||||
|
||||
@@ -192,60 +172,60 @@ Check Pi-hole Core, Web Interface and FTL repositories to determine what upgrade
|
||||
### Version
|
||||
|
||||
| | |
|
||||
--------------- | ---------------
|
||||
Help Command | `pihole version`
|
||||
Script Location | [`/opt/pihole/version.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/version.sh)
|
||||
Example Usage | `pihole -v -c`
|
||||
| --------------- | --------------- |
|
||||
| Help Command | `pihole version` |
|
||||
| Script Location | [`/opt/pihole/version.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/version.sh) |
|
||||
| Example Usage | `pihole -v -c` |
|
||||
|
||||
Shows installed versions of Pi-hole, Web Interface & FTL. It also provides options to configure which details will be printed, such as the current version, latest version, hash and subsystem.
|
||||
|
||||
### Uninstall
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/etc/.pihole/automated install/uninstall.sh`](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/uninstall.sh)
|
||||
Example Usage | [`pihole uninstall`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#uninstall)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/etc/.pihole/automated install/uninstall.sh`](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/uninstall.sh) |
|
||||
| Example Usage | [`pihole uninstall`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#uninstall) |
|
||||
|
||||
Uninstall Pi-hole from your system, giving the option to remove each dependency individually.
|
||||
|
||||
### Status
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole status`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#status)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole status`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#status) |
|
||||
|
||||
Display the running status of Pi-hole's DNS and blocking services.
|
||||
|
||||
### Enable & Disable
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole disable --help`
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole disable 5m`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#toggle)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole disable --help` |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole disable 5m`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#toggle) |
|
||||
|
||||
Toggle Pi-hole's ability to block unwanted domains. The disable option has the option to set a specified time before blocking is automatically re-enabled.
|
||||
|
||||
### Restart DNS
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | [`pihole restartdns`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#restartdns)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | [`pihole restartdns`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#restartdns) |
|
||||
|
||||
Restart Pi-hole's DNS service.
|
||||
|
||||
### Checkout
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | `pihole checkout --help`
|
||||
Script Location | [`/opt/pihole/piholeCheckout.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeCheckout.sh)
|
||||
Example Usage | [`pihole checkout dev`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#checkout)
|
||||
| -------------- | -------------- |
|
||||
| Help Command | `pihole checkout --help` |
|
||||
| Script Location | [`/opt/pihole/piholeCheckout.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeCheckout.sh) |
|
||||
| Example Usage | [`pihole checkout dev`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#checkout) |
|
||||
|
||||
Switch Pi-hole subsystems to a different GitHub branch. An admin can specify repositories as well as branches.
|
||||
|
||||
@@ -254,19 +234,9 @@ Switch Pi-hole subsystems to a different GitHub branch. An admin can specify rep
|
||||
### Password
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole)
|
||||
Example Usage | `pihole setpassword`
|
||||
| -------------- | -------------- |
|
||||
| Help Command | N/A |
|
||||
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
|
||||
| Example Usage | `pihole setpassword` |
|
||||
|
||||
Set the Web Interface an API password. Password can be entered as an option (e.g: `pihole setpassword secretpassword`), or separately as to not display on the screen (e.g: `pihole setpassword`).
|
||||
|
||||
### Teleport
|
||||
|
||||
| | |
|
||||
-------------- | --------------
|
||||
Help Command | N/A
|
||||
Script Location | N/A
|
||||
Example Usage | `pihole -a -t`
|
||||
|
||||
Create a configuration backup. The backup will be created in the directory from which the command is run. The backup can be imported using the Settings > Teleport page.
|
||||
|
||||
@@ -78,13 +78,13 @@ Example | Interpretation
|
||||
## Alternations (`|`)
|
||||
|
||||
Alternations can be used as an "or" operator in regular expressions.
|
||||
|
||||
<!-- markdownlint-disable MD056 -->
|
||||
Example | Interpretation
|
||||
--- | ---
|
||||
`(abc)|(def)` | matches `abc` *and* `def`
|
||||
`domain(a|b)\.com` | matches `domaina.com` and `domainb.com` but not `domain.com` or `domainx.com`
|
||||
`domain(a|b)*\.com` | matches `domain.com`, `domainaaaa.com` `domainbbb.com` but not `domainab.com` (any number of `a` or `b` in between `domain` and `.com`)
|
||||
|
||||
<!-- markdownlint-enable MD056 -->
|
||||
## Character classes (`[:class:]`)
|
||||
|
||||
In addition to character groups, there are also some special character classes available, such as
|
||||
@@ -125,7 +125,7 @@ Blocks domains containing only numbers (no letters) and ending in `.com` or `.ed
|
||||
A domain name shall not start or end with a dash but can contain any number of them. It must be followed by a TLD (we assume a valid TLD length of two to seven characters)
|
||||
|
||||
# Cheatsheet
|
||||
|
||||
<!-- markdownlint-disable MD056 -->
|
||||
Expression | Meaning | Example
|
||||
------------ | ------------- | -----------
|
||||
`^` | Beginning of string | `^client` matches strings that begin with `client`, such as `client.server.com` but not `more.client.server.com` (exception: within a character range (`[]`) `^` means negation)
|
||||
@@ -140,3 +140,4 @@ Expression | Meaning | Example
|
||||
`[^]`| Negation | `[^0-9]` matches any character *except* `0` to `9`
|
||||
`{ }` | Matches a specified number of occurrences of the previous | `[0-9]{3}` matches any three-digit number like `315` but not `31`;<br>`[0-9]{2,4}` matches two- to four-digit numbers like `12`, `123`, and `1234` but not `1` or `12345`;<br>`[0-9]{2,}` matches any number with two or more digits like `1234567`, `123456789`, but not `1`
|
||||
`\` | Used to escape a special character not inside `[]` | `google\.com` matches `google.com`
|
||||
<!-- markdownlint-enable MD056 -->
|
||||
|
||||
Reference in New Issue
Block a user