Skip to content

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

FieldTypeDefaultAllowed valuesDescription
enableboolfalsetrue | falseTurn the embedded NTP client on. When off, the rest of the block is ignored.
serverstring(unset)<hostname> | <IP>NTP server. Common choices: time.cloudflare.com, time.apple.com, time.google.com.
portint123<port>NTP server port. Standard NTP is UDP/123.
intervalint30<minutes>Time between NTP queries, in minutes. Plain integer; not a duration string.
dialer-proxystring(direct)<proxy name> | <proxy group>Send NTP traffic through a configured proxy. Useful when port 123 is blocked on the local network.
write-to-systemboolfalsetrue | falseAfter 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: false

Notes

  • interval is minutes, not a Go-style duration string. interval: 30 is "every 30 minutes".
  • If dialer-proxy references 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)

Core Tutorial by Argsment