Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

asked on

Can we set hostname using the DHCP ?

Suppose I have modified my /etc/hosts and /etc/nodename as 'foo'
and at DHCP server my IP address bound to my MAC address and associated hostname is 'bar'


so when I request from DHCP for auto host configuration, will my hostname would be changed from 'foo' to 'bar' ??
Avatar of kyleb84
kyleb84
Flag of Australia image

No, dhclient (The DHCP Client daemon) does not set your hostname to what it receives in a lease (by default).

If you want custom host names bound to specific IP's use an internal DNS server...
- add that server into the DHCP lease
- add the hosts into the DNS records
ASKER CERTIFIED SOLUTION
Avatar of Brian Utterback
Brian Utterback
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
please see the file /etc/default/dhcpagent which contains some info in this regard and a parameter
Avatar of beer9

ASKER

Thanks blu!