I can't figure out the difference from just the man pages. I can see what is a daemon and one is a client, but what does that mean practically when using the commands? Also what is the difference between the client and daemon in this case, not just the terms (client and daemon) but functionally wise? EDIT: How are the tasks divided, if the client updates the information on the client, what is the purpose of the daemon. I'm talking about the client daemon in this case dhcpcd not dhcpd. Both come installed by default with some versions of Linux and seem to share the duties of the dhcp client.

NAME dhcpcd - DHCP client daemon

dhclient - Dynamic Host Configuration Protocol Client 

ISC provides dhclient, and as such, it serves as sort of a reference. The more lightweight dhcpcd is somewhat more up to date. Both dhcpcd and dhclient are fully capable DHCP client daemons. Dhclient is not a "one-time" utility:

man dhclient

-w Continue running even if no broadcast interfaces were found. Normally DHCP client will exit if it isn't able to identify any network interfaces to configure. (...)

That is more like the default behavior of dhcpcd.

DHCP has been kind of a moving target, with various vendors (Microsoft in particular) introducing various deviations from the standard.

| improve this answer | |

Debian offers a dhcpcd package. The package description reads as follows:

Simple configuration: supports executions of a script when the IP address changes.

dhclient is usually used in this fashion: dhclient -v eth0 or similar - what will happen is that it will send a broadcast out of eth0, and if a DHCP server replies, it will apply information given to eth0. It will then exit. It will not monitor the interface thereafter. I haven't used dhcpcd but I presume that is its purpose.

You would use dhclient if things are messed up and you wanted to fetch a fresh IP from a DHCP server manually. Good tool to have and that is why many distros include it I suppose.

| improve this answer | |

dhclient is a one-shot client - it reaches out to a server once and only once to request or validate a client's IP address.

In contrast, dhcpcd runs in background and actively manages re-requests after expired lease time etc. pp. without needing to be called again.

BTW do not confuse dhcpcd and dhcpd. The latter is a dhcp server - that is it hands out addresses to network devices when configured to do so. You generally will not use dhcpd on a computer unless you are using that particular computer to manage IP addresses for the entire network.

| improve this answer | |
  • 3
    Downvoting: I disagree. I have seen dhclient remain running, and handle DHCP lease renewals. Maybe your info is accurate for some dhclient software version, but not ISC dhclient (which is typically the reference version). Try checking to see what is running after dhclient seems to be done doing its thing. You may find that, even though it did return the terminal back to a command prompt, it is still running. – TOOGAM Apr 21 '15 at 12:18

It looks like ISC dhclient is not a one-shot client. Its manpage, man dhclient(8) says:

Normally the DHCP client will run in the foreground until is has
configured an interface at which time it will revert to running in
the background.

You can use -1 flag to ask dhclient to try only once to get an IP and then exit on fail. From man page:

The -1 flag cause dhclient to try once to get a lease.  If it 
fails, dhclient exits with exit code two.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.