You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/auth.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Authentication is required for most API endpoints. The Pi-hole API uses a session-based authentication system. This means that you will not be able to use a static token to authenticate your requests. Instead, you will be given a session ID (SID) that you will have to use. If you didn't set a password for your Pi-hole, you don't have to authenticate your requests.
2
2
3
-
To get a session ID, you will have to send a `POST` request to the `/api/auth` endpoint with a payload containing your password. Note that is also possible to use an application password instead of your regular password, e.g., if you don't want to put your password in your scripts or if you have 2FA enabled for your regular password. One application password can be generated in the web interface on the settings page.
3
+
To get a session ID, you will have to send a `POST` request to the `/api/auth` endpoint with a payload containing your password. Note that it is also possible to use an application password instead of your regular password, e.g., if you don't want to put your password in your scripts or if you have 2FA enabled for your regular password. One application password can be generated in the web interface on the settings page.
4
4
5
5
<!-- markdownlint-disable code-block-style -->
6
6
???+ example "Authentication with password"
@@ -138,7 +138,7 @@ Once you have a valid SID, you can use it to authenticate your requests. You can
138
138
3. In the `X-FTL-SID` header: `X-FTL-SID: vFA+EP4MQ5JJvJg+3Q2Jnw=`
139
139
4. In the `sid` cookie: `Cookie: sid=vFA+EP4MQ5JJvJg+3Q2Jnw=`
140
140
141
-
Note that when using cookie-based authentication, you will also need to send a `X-FTL-CSRF` header with the CSRF token that was returned when you authenticated. This is to prevent a certain kind of identify theft attack the Pi-hole API is immune against.
141
+
Note that when using cookie-based authentication, you will also need to send a `X-FTL-CSRF` header with the CSRF token that was returned when you authenticated. This is to prevent a certain kind of identity theft attack the Pi-hole API is immune against.
Copy file name to clipboardExpand all lines: docs/api/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Most (but not all) endpoints require authentication. API endpoints requiring aut
4
4
5
5
## Accessing the API documentation
6
6
7
-
The entire API is documented at http://pi.hole/api/docs and self-hosted by your Pi-hole to match 100% the API versions your local Pi-hole has. Using this locally served API documentation is preferred. In case you don't have Pi-hole installed yet, you can also check out the documentation for all branches online, e.g., [Pi-hole API documentation](https://ftl.pi-hole.net/master/docs/) (branch `master`). Similarly, you can check out the documentation for a specific other branches by replacing `master` with the corresponding branch name. <!-- markdownlint-disable-line no-bare-urls -->
7
+
The entire API is documented at http://pi.hole/api/docs and self-hosted by your Pi-hole to match 100% the API version your local Pi-hole has. Using this locally served API documentation is preferred. In case you don't have Pi-hole installed yet, you can also check out the documentation for all branches online, e.g., [Pi-hole API documentation](https://ftl.pi-hole.net/master/docs/) (branch `master`). Similarly, you can check out the documentation for a specific other branches by replacing `master` with the corresponding branch name. <!-- markdownlint-disable-line no-bare-urls -->
8
8
9
9
## API endpoints
10
10
@@ -118,7 +118,7 @@ In contrast, errors have a uniform, predictable style to ease their programmatic
118
118
119
119
## HTTP methods used by this API
120
120
121
-
Each HTTP request consists of a method that indicates the action to be performed on the identified resource. The relevant standards is [RFC 2616](https://tools.ietf.org/html/rfc2616). Though, RFC 2616 has been very clear in differentiating between the methods, complex wordings are a source of confusion for many users.
121
+
Each HTTP request consists of a method that indicates the action to be performed on the identified resource. The relevant standard is [RFC 2616](https://tools.ietf.org/html/rfc2616). Though, RFC 2616 has been very clear in differentiating between the methods, complex wordings are a source of confusion for many users.
122
122
123
123
Pi-hole's API uses the methods like this:
124
124
@@ -168,7 +168,7 @@ Method | Description
168
168
`DELETE` operations are **idempotent**. If you `DELETE` a resource, it’s removed from the collection of resources. Repeatedly calling `DELETE` on that resource will not change the outcome – however, calling `DELETE` on a resource a second time *may* return a 404 (NOT FOUND) since it was already removed.
169
169
170
170
???+ info "Example"
171
-
Let’s list down few URIs and their purpose to get better understanding when to use which method:
171
+
Let’s list down a few URIs and their purpose to get better understanding when to use which method:
Copy file name to clipboardExpand all lines: docs/database/query-database.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The long-term database contains several tables:
40
40
41
41
### Query Table
42
42
43
-
Label | Type | Allowed to by empty | Content
43
+
Label | Type | Allowed to be empty | Content
44
44
--- | --- | ---- | -----
45
45
`id` | integer | No | autoincrement ID for the table, only used by SQLite3, not by *FTL*DNS
46
46
`timestamp` | integer | No | Unix timestamp when this query arrived at *FTL*DNS (used as index)
@@ -73,7 +73,7 @@ If a query was influenced by a deny or allowlist entry, this field contains the
73
73
74
74
This table contains counter values integrated over the entire lifetime of the table
75
75
76
-
Label | Type | Allowed to by empty | Content
76
+
Label | Type | Allowed to be empty | Content
77
77
--- | --- | ---- | -----
78
78
`id` | integer | No | ID for the table used to select a counter (see below)
79
79
`value` | integer | No | Value of a given counter
@@ -170,29 +170,29 @@ The `queries` `VIEW` reads repeating properties from linked tables to reduce bot
170
170
171
171
#### `domain_by_id`
172
172
173
-
Label | Type | Allowed to by empty | Content
173
+
Label | Type | Allowed to be empty | Content
174
174
--- | --- | --- | ---
175
175
`id` | integer | No | ID of the entry. Used by `query_storage`
176
176
`domain` | text | No | Domain name
177
177
178
178
#### `client_by_id`
179
179
180
-
Label | Type | Allowed to by empty | Content
180
+
Label | Type | Allowed to be empty | Content
181
181
--- | --- | --- | ---
182
182
`id` | integer | No | ID of the entry. Used by `query_storage`
183
183
`ip` | text | No | Client IP address
184
184
`name` | text | Yes | Client host name
185
185
186
186
#### `forward_by_id`
187
187
188
-
Label | Type | Allowed to by empty | Content
188
+
Label | Type | Allowed to be empty | Content
189
189
--- | --- | --- | ---
190
190
`id` | integer | No | ID of the entry. Used by `query_storage`
191
191
`forward` | text | No | Upstream server identifier (`<ipaddr>#<port>`)
192
192
193
193
#### `addinfo_by_id`
194
194
195
-
Label | Type | Allowed to by empty | Content
195
+
Label | Type | Allowed to be empty | Content
196
196
--- | --- | --- | ---
197
197
`id` | integer | No | ID of the entry. Used by `query_storage`
198
198
`type` | integer | No | Type of the `content` field
@@ -205,7 +205,7 @@ Valid `type` IDs are currently
205
205
206
206
### Example for interaction with the long-term query database
207
207
208
-
In addition to the interactions the Pi-hole database API offers, you can also run your own SQL commands against the database. If you want to obtain the three most queries domains for all time, you could use
208
+
In addition to the interactions the Pi-hole database API offers, you can also run your own SQL commands against the database. If you want to obtain the three most queried domains for all time, you could use
209
209
210
210
```bash
211
211
sqlite3 "/etc/pihole/pihole-FTL.db""SELECT domain,count(domain) FROM queries WHERE (STATUS == 2 OR STATUS == 3) GROUP BY domain ORDER BY count(domain) DESC LIMIT 3"
Copy file name to clipboardExpand all lines: docs/ftldns/dns-cache.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
If a DNS name exists in the cache, but its time-to-live (TTL) has expired only recently, the data will be used anyway (a refreshing from upstream is triggered). This can improve DNS query delays especially over unreliable or slow Internet connections. This feature comes at the expense of possibly sometimes returning out-of-date data and less efficient cache utilization, since old data cannot be flushed when its TTL expires, so the cache becomes mostly least-recently-used. To mitigate issues caused by massively outdated DNS replies, the maximum overaging of cached records is limited. We strongly recommend staying below 86400 (1 day) with this option. The default value of `dns.cache.optimizer` is one hour (`3600` seconds) which was carefully tested to provide a good balance between cache efficiency and query performance without having otherwise adverse effects. Our investigations revealed, that there has always been a grace time larger than an hour in addition to the TTL of DNS records, so this value should be safe for any practical use cases.
17
17
18
-
## Cacheing of queries blocked upstream (`dns.cache.upstreamBlockedTTL`)
18
+
## Caching of queries blocked upstream (`dns.cache.upstreamBlockedTTL`)
19
19
20
20
This setting allows you to specify the TTL used for queries blocked upstream. Once the TTL expires, the query will be forwarded to the upstream server again to check if the block is still valid. Defaults to caching for one day (86400 seconds). Setting `dns.cache.upstreamBlockedTTL` to zero disables caching of queries blocked upstream.
Copy file name to clipboardExpand all lines: docs/ftldns/dns-resolver.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Users can configure the size of the resolver's name cache. The default is 150 na
20
20
21
21
#### Improve detection algorithm for determining the "best" forward destination
22
22
23
-
The DNS forward destination determination algorithm in *FTL*DNS's is modified to be much less restrictive than the original algorithm in `dnsmasq`. We keep using the fastest responding server now for 1000 queries or 10 minutes (whatever happens earlier) instead of 50 queries or 10 seconds (default values in `dnsmasq`).
23
+
The DNS forward destination determination algorithm in *FTL*DNS is modified to be much less restrictive than the original algorithm in `dnsmasq`. We keep using the fastest responding server now for 1000 queries or 10 minutes (whatever happens earlier) instead of 50 queries or 10 seconds (default values in `dnsmasq`).
24
24
We keep the exceptions, i.e., we try all possible forward destinations if `SERVFAIL` or `REFUSED` is received or if a timeout occurs.
25
25
Overall, this change has proven to greatly reduce the number of actually performed queries in typical Pi-hole environments. It may even be understood as being preferential in terms of privacy (as we send queries much less often to all servers).
26
26
This has been implemented in commit [d1c163e](https://github.com/pi-hole/FTL/commit/d1c163e499a5cd9f311610e9da1e9365bbf81e89).
Copy file name to clipboardExpand all lines: docs/ftldns/dnsmasq_warn.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ Warnings commonly seen in `dnsmasq`'s log file (`/var/log/pihole/pihole.log`) an
167
167
168
168
!!! warning "overflow: `NUMBER` log entries lost"
169
169
170
-
When using asynchronous logging and the disk is too slow, we can loose log lines during busy times. This can be avoided by decreasing the system load or switching to synchronous logging. Note that synchronous logging has the disadvantage of blocking DNS resolution when waiting for the log to be written to disk.
170
+
When using asynchronous logging and the disk is too slow, we can lose log lines during busy times. This can be avoided by decreasing the system load or switching to synchronous logging. Note that synchronous logging has the disadvantage of blocking DNS resolution when waiting for the log to be written to disk.
171
171
172
172
!!! warning "failed to create listening socket for `ADDRESS`: `MSG`"
Copy file name to clipboardExpand all lines: docs/main/faq.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ In a normal setup this results in a “No such name” response from your DNS se
20
20
21
21
Link to [Chromium's source code](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/chrome/browser/intranet_redirect_detector.cc#132) explaining the function.
22
22
23
-
### Pi-hole update fails due to repository changed it's 'Suite' value
23
+
### Pi-hole update fails due to repository changed its 'Suite' value
24
24
25
25
This happens after a manual OS upgrade to the next major version on deb based systems. A typical message is
Copy file name to clipboardExpand all lines: docs/main/pihole-command.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ Gravity is one of the most important scripts of Pi-hole. Its main purpose is to
117
117
* It will determine Internet connectivity, and give time for `pihole-FTL` to be resolvable on low-end systems if has just been restarted
118
118
* It extracts all URLs and domains from the `adlists` table in [`/etc/pihole/gravity.db`](../database/domain-database/index.md)
119
119
* It runs through each URL, downloading it if necessary
120
-
*`curl` checks the servers`Last-Modified` header to ensure it is getting a newer version
120
+
*`curl` checks the server's`Last-Modified` header to ensure it is getting a newer version
121
121
* It will attempt to parse the file into a domains-only format if necessary
122
122
* Lists are merged, comments removed, sorted uniquely and stored in the `gravity` table of [`/etc/pihole/gravity.db`](../database/domain-database/index.md)
123
123
* Gravity cleans up temporary content and reloads the DNS server
0 commit comments