DHCP Time Server Options: Comparing Option 004 vs 042 with NTP Implementation Considerations


2 views

When configuring network time synchronization via DHCP, administrators encounter two competing options in RFC 2132:

  • Option 4 (Time Server): Specifies a list of 32-bit IPv4 addresses for time servers (RFC 868 protocol)
  • Option 42 (NTP Server): Provides NTP (Network Time Protocol) server addresses (RFC 5905)

The key distinction lies in the time protocol each option serves:


# Example DHCPd configuration showing both options
option time-servers 192.168.1.10, 192.168.1.11;  # Option 4
option ntp-servers 10.0.0.5, 10.0.0.6;           # Option 42

Modern operating systems handle these options differently:

OS Preferred Option Fallback Behavior
Windows 10/11 Option 42 (NTP) Uses Option 4 if 42 unavailable
Linux (systemd-timesyncd) Option 42 only Ignores Option 4 completely
macOS Option 42 Uses Apple's time servers if none specified

The time offset (Option 2) remains relevant regardless of which time server option is used. This 32-bit signed integer specifies the UTC offset in seconds. In NTP implementations:


# Example showing time offset with NTP servers
option time-offset -18000;  # -5 hours (EST)
option ntp-servers pool.ntp.org;

For modern networks:

  1. Always configure Option 42 (NTP) as primary
  2. Include Option 4 for legacy device support
  3. Set Option 2 when dealing with non-UTC timezones
  4. Test client behavior with dhcpcd -T or equivalent

Diagnosing time sync issues on Linux:


# Check DHCP-assigned NTP servers
journalctl -u systemd-timesyncd -f

# Verify DHCP options received
dhcpcd --dumplease eth0 | grep -i 'ntp\|time'

For Windows clients, use w32tm /query /configuration to verify time source selection.


When configuring time synchronization through DHCP, network administrators encounter two primary options:

# Common DHCP time-related options
option time-offset 002;      # Signed 32-bit integer (seconds from UTC)
option time-servers 004;     # List of IPv4 addresses (RFC 868 time protocol)
option ntp-servers 042;      # List of IPv4 addresses (NTP protocol)

Option 004 implements RFC 868 time protocol (TCP port 37), which provides:

  • 32-bit unsigned seconds since 1900-01-01
  • No fractional seconds or timezone information
  • Basic time synchronization without sub-second precision

Option 042 implements NTP (RFC 5905) with:

  • 64-bit timestamps (32-bit seconds + 32-bit fractions)
  • Nanosecond precision
  • Comprehensive time synchronization features

Modern operating systems typically prefer NTP (option 042):

# Example Linux dhclient configuration
interface "eth0" {
    send dhcp-requested-options 42;
    request subnet-mask, routers, domain-name-servers, ntp-servers;
}

Windows DHCP clients combine both options:

# Example Windows registry NTP configuration
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
"NtpServer" = "pool.ntp.org,0x9"

For mixed environments, include both options in your DHCP server configuration:

# ISC DHCP server example
option ntp-servers 192.168.1.10, 192.168.1.11;
option time-servers 192.168.1.10;
option time-offset -28800; # PST offset (-8 hours)

The time offset (option 002) remains relevant for:

  • Devices without NTP client capabilities
  • Initial time synchronization before NTP takes over
  • Embedded systems with limited timekeeping functionality

Check received DHCP options on Linux:

dhclient -v eth0
cat /var/lib/dhcp/dhclient.leases

On Windows:

ipconfig /all | findstr "NTP"
w32tm /query /configuration