tarjei99
Posts: 6
Joined: Wed Aug 23, 2017 3:14 pm

DHCP - two competing services

Sat Feb 10, 2018 1:37 pm

Hi,

I have just discovered that my Raspbian PI have both dhcpcd and dhclient installed and in use. And I know I've not installed either so I'm inclined to believe that they are both active in the installation kit.

The machine works fine with this setup until one wants to make special changes such as adding a DNS server which is not supplied by DHCP. Then it becomes weird.

It might be a good idea to disable one or the other. But which one?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6027
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: DHCP - two competing services

Sat Feb 10, 2018 1:43 pm

How have you determined that they're both used? What's starting dhclient on your system?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: DHCP - two competing services

Sat Feb 10, 2018 1:55 pm

I don't see where a dhclient service is running.

If you want to add dns servers, open /etc/dhcpcd.conf with a text editor and add this at the end. This adds google dns servers.

Code: Select all

static domain_name_servers=8.8.8.8 8.8.4.4
Reboot.

tarjei99
Posts: 6
Joined: Wed Aug 23, 2017 3:14 pm

Re: DHCP - two competing services

Sat Feb 10, 2018 3:02 pm

dhclient lease file in /var/lib/dhcp/dhclient.leases
It reflects changes I've made in /etc/dchp/dhclient.conf
I found log entries from dhclient in some of the /var/log logs.

/etc/resolv.conf was generated by resolvconf

resolvconf -l shows that the original /etc/resolv.conf was created by dhcpcd.

So there is no doubt that both programs are active concurrently on the machine.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: DHCP - two competing services

Sat Feb 10, 2018 3:22 pm

So you tried my suggestion and it failed?

Does /etc/resolv.conf show the new dns servers?

tarjei99
Posts: 6
Joined: Wed Aug 23, 2017 3:14 pm

Re: DHCP - two competing services

Sat Feb 10, 2018 3:52 pm

I added the new DNS server in resolvconf.conf. That will work regardless of which service wins.

Return to “Troubleshooting”