Ask Your Question

Setting hostname through DHCP

asked 2012-03-17 19:34:02 -0500

KevinA gravatar image

updated 2014-09-28 08:51:37 -0500

mether gravatar image

I know it is possible to set a preferred hostname through DHCP and have the DHCP server automatically setup the forward and reverse DNS for that hostname. On a static IP box without NetworkManager it is possible to add DHCPHostname="DesiredHostname" to the /etc/sysconfig/network-scripts/ifcfg-eth0 script and it will pull down an IP and setup the DNS according to the hostname that you asked. Now the question is does anyone know how to do it with NetworkManager? If have tried adding DHCPHostname="DesiredHostname" to /etc/sysconfig/network-scripts/ifcfg_Auto-SSID as well as to /etc/sysconfig/network without success. Also this is on a laptop with Fedora 16.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-20 10:31:14 -0500

KevinA gravatar image

So I created the file with my desired host name but it did not send it for some reason. I changed everything back to the default settings and changed my host name to something new and that registers in DHCP.

edit flag offensive delete link more

answered 2012-03-19 17:51:02 -0500

skorzen gravatar image

Try to create a /etc/dhclient-$IFNAME.conf file, like /etc/dhclient-eth1.conf.

Content would be:

send host-name "your_hostname";
request subnet-mask, broadcast-address, time-offset, routers,
domain-search, domain-name, domain-name-servers, host-name;
edit flag offensive delete link more

Question Tools


Asked: 2012-03-17 19:34:02 -0500

Seen: 3,403 times

Last updated: Mar 20 '12