Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Name
dhclient - Dynamic Host Configuration Protocol Client 
share|improve this question

4 Answers 4

up vote 5 down vote accepted

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.

share|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.

share|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.

share|improve this answer

It looks like ISC dhclient is not a one-shot client. It's man page says:

The DHCP client will normally run in the foreground until it has 
configured an interface, and then will revert to running in the 
back-ground.

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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