Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix nightly manual

This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.

NAME

dhclient — dynamic host configuration protocol client

SYNOPSIS

dhclient [-f config] [-t] interface

DESCRIPTION

dhclient dynamically configures the specified network interface (if(4)) and the Domain Name System (DNS) server list via the Dynamic Host Configuration Protocol (DHCP) with settings obtained from the local network's DHCP server.
dhclient is configured in dhclient.conf(5). Each network setting can be configured to be automatically obtained from the network (default), set manually, or not set at all. If the interface is fully manually configured, dhclient sets the configuration and exits immediately.
dhclient broadcasts a request and selects a DHCP server to obtain the network configuration from. dhclient leases an internet address as needed and remains running to occasionally renew the release.
The options are as follows:
-f config
Load the configuration from the config file instead as a shared configuration file instead of searching for it.
-t
Test the configuration is valid without configuring the network interface. The interface can optionally be specified to search for its configuration file. Exit 0 if the configuration is valid and non-zero otherwise.
Port 68 on the network interface is bound to send and receive DHCP messages. dhclient exits 0 immediately if the port is already bound to avoid interfering with other dhclient processes.
dhclient supports the Ethernet link layer ether(4) with the Internet Protocol network layer ip(4). The loopback interface lo(4) does not need to be configured and dhclient immediately exits successfully.
Network interfaces can be manually configured using ifconfig(8) and the DNS servers using dnsconfig(8). dhclient will occasionally reset the configuration when the internet address lease is renewed unless disabled.
dhclient is typically automatically started as the dhclient daemon, which is depended on by the network daemon per the init(5) configuration.

IMPLEMENTATION NOTES

dhclient signals readiness when it has attempted to configure the network interface and continues retrying afterwards. The first attempt fails if the network interface's link doesn't come up within 10 seconds. Packets are transmitted 6 times with an exponential backoff before giving up and the configuration restarts.

FILES

/etc/dhclient.${mac}.conf
The preferred dhclient.conf(5) file for the interface with the hardware address mac.
/etc/dhclient.${if}.conf
The second priority dhclient.conf(5) file for the interface with the device name if.
/etc/dhclient.conf
The lowest priority dhclient.conf(5) file shared across all network interfaces.

ASYNCHRONOUS EVENTS

SIGTERM
Request daemon termination.

EXIT STATUS

dhclient runs as a daemon(7) until stopped by SIGTERM. dhclient signals readiness on the READYFD file descriptor when the interface is configured, when waiting for the link to come up times out, or when the DHCP server doesn't respond in time or configuration fails. dhclient will exit 0 if the network interface doesn't need to be configured or is fully manually configured and will exit non-zero on any fatal startup error.

EXAMPLES

See dhclient.conf(5) for example configurations.
See init(5) for an example disabling the dhclient daemon by removing the network daemon's dependency on it.

SEE ALSO

ether(4), if(4), inet(4), ip(4), dnsconfig(8), ifconfig(8), init(8)

STANDARDS

R. Droms, Dynamic Host Configuration Protocol, RFC 2131, Network Working Group, March 1997.
S. Alexander and R. Droms, DHCP Options and BOOTP Vendor Extensions, RFC 2132, Network Working Group, March 1997.
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org