Skip to content

Commit 40713ac

Browse files
authoredMar 24, 2025··
Merge pull request #1218 from rrobgill/ntpguide
Add short guide to NTP settings to docs
2 parents d783db5 + dacd18a commit 40713ac

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
 

‎docs/guides/misc/all_settings.png

18.6 KB
Loading

‎docs/guides/misc/ntp.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Configuring NTP (Network Time Protocol) on your Pi-hole
2+
3+
## What is NTP?
4+
5+
Network Time Protocol (NTP) is used to synchronise the clocks of devices on a network, ensuring they report the same time. In a home network, NTP helps keep computers, routers, and iot/smart devices running on the same time, ensuring consistency between scheduling events, logging activities, and within time-sensitive applications. It works by connecting to time servers on the internet, which provide accurate time based on atomic clocks. A server on your own network can then relay the information to devices on your network. Operating your own server minimises external traffic and helps keep the time consistent across your devices.
6+
7+
# Configuring Pi-hole's NTP client and server
8+
9+
Settings relating to NTP are in the "Network Time Sync" tab of the All Settings page. If All Settings is not visible, click where it says "Basic" at the top right to toggle the Expert settings, and All Settings will become visible in the Settings section.
10+
11+
![](all_settings.png)
12+
13+
## Client settings
14+
15+
Pi-hole acts as an NTP client, synchronising the time on your Raspberry Pi or other system with that provided by a reliable online source. Having the correct time ensures that certificates fall within their valid time frame, allowing protocols such as DNSSEC to work effectively.
16+
17+
The NTP client is enabled by default, but can be disabled by deselecting `ntp.sync.active`
18+
19+
### Upstream NTP Server
20+
21+
You can specify the server you wish to synchronise with at `ntp.sync.server`
22+
23+
The default server is `pool.ntp.org`, which selects a server from the [NTP pool project](https://www.ntppool.org), a virtual cluster of timeservers providing reliable, easy to use NTP service. The NTP Pool is generally of very high quality, but it is a service run by volunteers in their spare time.
24+
25+
Other public ntp servers include
26+
[`time.cloudflare.com`](https://www.cloudflare.com/time/), [`time.facebook.com`](https://engineering.fb.com/production-engineering/ntp-service/) and [`time.google.com`](https://developers.google.com/time/)
27+
28+
If your ISP provides an NTP server (or if there is an NTP server on your network), you may enter its address here.
29+
30+
Typically the closer you are to the server there will be less network jitter, and you will be able to obtain a more accurate time.
31+
32+
### Synchronisation frequency
33+
34+
The frequency that Pi-hole queries the server is set at `ntp.sync.interval`, and the number of readings compared at each synchronisation is set at `ntp.sync.count`
35+
36+
By default this is set to `3600` seconds, so that Pi-hole will synchronise the time once every hour, taking the average of `8` readings.
37+
38+
If there is an NTP server on your network, the time between queries can be decreased here.
39+
40+
If you are using a public time server, note that querying excessively violates the terms of use of many public servers, and could result in your IP being banned.
41+
42+
## Server settings
43+
44+
Pi-hole acts as an NTP server, allowing other devices on your network to synchronise their time with it. This passes along the accurate time that was obtained over the internet.
45+
46+
The NTP server is enabled by default, but can be disabled by deselecting `ntp.ipv4.active` and `ntp.ipv6.active`.
47+
48+
### Listening addresses
49+
50+
By default, Pi-hole will respond to NTP requests on all addresses. The Pi-hole NTP server can be restricted to listening to a single address, which may be specified by `ntp.ipv4.address` and `ntp.ipv6.address`.
51+
52+
## Real time clock (RTC) synchronisation
53+
54+
Pi-hole is able to set the time of the hardware real time clock, if present. This makes the time more accurate immediately after reboot. Note that not all devices are fitted with hardware clocks, Raspberry Pis in particular do not ship with a hardware clock.
55+
56+
This is enabled by the setting `ntp.sync.rtc.set`.
57+
58+
### RTC location
59+
60+
The path to the real time clock can be specified at `ntp.sync.rtc.device`.
61+
62+
## Advertising Pi-hole's NTP server to devices on your network
63+
64+
If Pi-hole is also operating as a DHCP server, it will also advertise the presence of your NTP server to devices on your network when it gives them their address.
65+
66+
Note that not all client devices are able to make use of this feature, and may need to be configured manually.

‎mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ nav:
211211
- 'Performance and other issues': guides/misc/tor/performance-issues.md
212212
- 'Using DNSSEC': guides/misc/tor/dnssec.md
213213
- 'Allowlist and Denylist editing': guides/misc/allowlist-denylist.md
214+
- 'Network Time Protocol': guides/misc/ntp.md
214215
- 'Router setup':
215216
- 'ASUS router': routers/asus.md
216217
- 'Fritz!Box (EN)': routers/fritzbox.md

0 commit comments

Comments
 (0)
Please sign in to comment.