Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to prevent dhcpcd from setting hostname got from server? Change of it breaks a lot of things (including X session).

My current distribution is Gentoo, init system is systemd and dhcpcd is spawn by networkmanager.

share|improve this question
1  
Try using this. –  n.m. Aug 2 '13 at 7:42

2 Answers 2

I believe you should add smth like following to your /etc/conf.d/net:

dhcpcd_eth0="-h yourhostname -H yourhostname"

P.S. You may want to check:

P.P.S. Personally I use dhclient because dhcpcd looks buggy for me.

share|improve this answer
    
Dhcpcd is spawned by NM so I cannot control the flags passed. Besides I use systemd so openrc's configuration flags are not applicable for that reason as well. –  Maciej Piechotka Aug 9 '13 at 6:28
up vote 0 down vote accepted

From n.m.'s link - the solution is described on NM webpage under 'Persistent Hostname'. One need to add to /etc/NetworkManager/NetworkManager.conf:

 [main]
 plugins=keyfile

 [keyfile]
 hostname=deepspace9
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.