About Linux FAQ

Browse More FAQs:

Configuring Linux Static DHCP Clients by Sending Host Name

Posted by Vivek Gite [Last updated: February 19, 2008]

Q. My DHCP server configured to assign static IPs to few Debian / Ubuntu Linux boxes using hostnames. My Windows 2000 and XP client computer sends hostname automatically. How do I send my hostname under Linux using dhcp client?

A. By default, the DHCP server requests the subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers and host-name options. DHCP client configuration allows you to set a hostname using send host-name "hostname" parameter.

Linux dhcpclient configuration - dhclient.conf

dhclient.conf is a configuration file for DHCP client under Linux:

  • Debian / Ubuntu Linux - /etc/dhcp3/dhclient.conf
  • RHEL / Fedora / CentOS Linux - /etc/sysconfig/network-scripts/ifcfg-eth0 (for 1st DHCP network interface)
WARNING! These examples requires correct hostname.

Debian / Ubuntu Linux DHCP Client Configuration

Open configuration file, enter:
$ sudo vi /etc/dhcp3/dhclient.conf
Set hostname as follows:
send host-name "vivek-laptop";
Save and close the file. Test new settings, enter:
$ sudo dhclient eth0
$ sudo dhclient interface-name

RHEL / CentOS / Fedora Linux DHCP Client Configuration

Open configuration file, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append hostname, enter:
DHCP_HOSTNAME=vivek-laptop
Save and close the file. Restart network service:
# service network restart
Please refer to dhclient.conf man page for more information, enter:
$ man dhclient.conf

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.