Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can get hostname and ip address from DHCP server with invoking the script under /etc/dhcp/dhclient-exit-hooks.d/ directory as explained here on client side.

I assigned host-name and ip address in /etc/dhcp/dhcpd.conf on server side:

host slave1 {
    hardware ethernet 00:50:56:89:A5:90;
    option host-name "slave1";

But it stopped after installed network manager. I realize that network manager doesn't invoke scripts under /etc/dhcp/dhclient-exit-hooks.d/ directory. After some research, I found that I can run a script under /etc/NetworkManager/dispatcher.d/ directory as explained here. I tried it (moved file, then gave permissions) but It didnt work. Because I can not reach variables like $reason, $interface, hostname etc. under that directory. I'm stuck here. So is there a way to get hostname from dhcp server via network manager? or how to run a script under dhclient-exit-hooks.d directory on boot even if network manager runs ?

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.