Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dhclient settings for local host name

On 19/03/2013 12:38, Ted Lemon wrote:
On Mar 19, 2013, at 4:34 AM, Riccardo Mottola
<> wrote:
I do not want to change any other parameter, is there an option or how can I write a config file to accomplish that? I tried, but apparently I override too many options and it doesn't work any more.

You should add a line like this to your /etc/dhclient.conf:

send host-name "foo";

(where foo is your hostname.)

I think this should do it; if it doesn't, make sure that your
parameter request list isn't asking for a host-name option.   If
that's not it, then check /etc/dhclient-script (it might be in /sbin,

Some silly DHCP servers send parameters even if you didn't ask for them. So it's possible to send the hostname FOO, not request the hostname paramter and get the hostname BAR returned. I'm not sure if dhclient has an option to ignore or strip parameters from the message - if not then edit /sbin/dhclient-script as Ted advises and just stop it from setting the hostname.

Or if you're using NetBSD-5 and upwards you can use dhcpcd(8) instead of dhclient(8) can add this to dhcpcd.conf(5)
nooption hostname

Which will strip the hostname parameter from any message before processing.



Home | Main Index | Thread Index | Old Index