dhclient Command
The dhclient command is a DHCP client that automatically configures network interfaces by obtaining IP addresses, subnet masks, default gateways, and DNS servers from a DHCP server.
Syntax
Description
The dhclient command provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol (DHCP). It automatically obtains network configuration from a DHCP server.
Key features:
- Automatically obtains IP addresses from DHCP servers
- Configures network settings like subnet mask and gateway
- Updates DNS configuration
- Supports lease renewal and release
- Can work with multiple network interfaces
Common Options
| Option | Description |
|---|---|
-r |
Release current lease and exit |
-d |
Run in foreground (debug mode) |
-v |
Verbose output |
-q |
Quiet mode (suppress output) |
-1 |
Try once and exit |
-cf file |
Use alternate configuration file |
-lf file |
Use alternate lease file |
-pf file |
Use alternate PID file |
Examples
Configure interface with DHCP
Configures the eth0 interface using DHCP
Configure all interfaces
Configures all available network interfaces
Release DHCP lease
Releases the current DHCP lease for eth0
Renew DHCP lease
Releases and then renews the DHCP lease
Run in verbose mode
Shows detailed output during DHCP configuration
Run in debug mode
Runs in foreground with debug output
Try once and exit
Attempts DHCP configuration once and exits
Use custom configuration file
Uses a custom DHCP client configuration file
Check current lease information
Displays current DHCP lease information