NTP
The ntp block configures mihomo's embedded NTP client. With it enabled, mihomo's internal clock no longer trusts the OS time — useful for TLS clock-skew tolerance on devices whose local clock drifts.
Options
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
enable | bool | false | true | false | Turn the embedded NTP client on. When off, the rest of the block is ignored. |
server | string | (unset) | <hostname> | <IP> | NTP server. Common choices: time.cloudflare.com, time.apple.com, time.google.com. |
port | int | 123 | <port> | NTP server port. Standard NTP is UDP/123. |
interval | int | 30 | <minutes> | Time between NTP queries, in minutes. Plain integer; not a duration string. |
dialer-proxy | string | (direct) | <proxy name> | <proxy group> | Send NTP traffic through a configured proxy. Useful when port 123 is blocked on the local network. |
write-to-system | bool | false | true | false | After each successful sync, push the time to the operating-system clock. Requires elevated privileges. |
Source: config/config.go:259-266 · pinned at v1.19.27 (5184081)
Example
yaml
ntp:
enable: true
server: time.cloudflare.com
port: 123
interval: 30
write-to-system: falseNotes
intervalis minutes, not a Go-style duration string.interval: 30is "every 30 minutes".- If
dialer-proxyreferences a proxy group that itself depends on NTP- sensitive operations (e.g. TLS), prefer a single direct proxy to avoid bootstrapping cycles.
Source: config/config.go:259-266 · v1.19.27 (5184081)
