mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-03-01 06:18:33 +00:00
Add documentation for whitelist and blacklist scripts
parent
cf7b537782
commit
58f448e0d7
1 changed files with 76 additions and 0 deletions
76
Whitelisting-and-Blacklisting.md
Normal file
76
Whitelisting-and-Blacklisting.md
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
There are two scripts to aid users in adding or removing domains to the whitelist or blacklist.
|
||||||
|
|
||||||
|
The scripts will first parse `whitelist.txt` or `blacklist.txt` for any changes, and if any additions or deletions are detected, it will reload dnsmasq so that they are effective immediately.
|
||||||
|
|
||||||
|
Each script accepts the following parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><code>[domain]</code></th>
|
||||||
|
<td>Fully qualified domain name you wish to add or remove. You can pass any number of domains.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>-d</code></th>
|
||||||
|
<td>Removal mode. Domains will be removed from the list, rather than added</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>-nr</code></th>
|
||||||
|
<td>Add or removed domains, but don't reload dnsmasq</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>-f</code></th>
|
||||||
|
<td>Force dnsmasq to reload even if the script did not detect any changes to the list</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>-q</code></th>
|
||||||
|
<td>Quiet mode. Console output is minimal. Useful for calling from another script (see <code>gravity.sh</code>)</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Domains passed are parsed by the script to ensure they are valid domains. If a domain is invalid it will be ignored.
|
||||||
|
|
||||||
|
|
||||||
|
#####Example `whitelist.sh` usages
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><code>whitelist.sh domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the whitelist and reload dnsmasq.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>whitelist.sh -nr domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the whitelist, but do not reload dnsmasq.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>whitelist.sh -f domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the whitelist and force dnsmasq to reload</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
To remove domains from the whitelist:
|
||||||
|
Add `-d` as an additional argument (e.g `whitelist.sh -d domain1 [domain2...]`)
|
||||||
|
|
||||||
|
#####Example `blacklist.sh` usages
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><code>blacklist.sh domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the blacklist and reload dnsmasq.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>blacklist.sh -nr domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the blacklist, but do not reload dnsmasq.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>blacklist.sh -f domain1 [domain2...]</code></th>
|
||||||
|
<td>Attempt to add one or more domains to the blacklist and force dnsmasq to reload</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
To remove domains from the blacklist:
|
||||||
|
Add `-d` as an additional argument (e.g `blacklist.sh -d domain1 [domain2...]`)
|
Loading…
Add table
Reference in a new issue