Setting the DHCP Hostname on Linux

On October 14, 2008, in Code Monkey, by Tom

I’m always forgetting how to register my machine name with the DHCP server so I can ping my box without having to remember my IP address. Here’s how to do it on Fedora Core 9:

  1. Set the hostname: `# hostname <hostname>`
  2. Add ‘HOSTNAME=<hostname>’ to ‘/etc/sysconfig/network’ (makes the change permanent).
  3. Add ‘DHCP_HOSTNAME=<hostname>’ to ‘/etc/sysconfig/network-scripts/ifcfg-eth0′
  4. Restart the networking service: `# service network restart`

Volia! Now you can connect to your box via hostname.

References:

Tagged with:  

One Response to Setting the DHCP Hostname on Linux

  1. [...] Tom Distler » Setting the DHCP Hostname on Linux To err is human, but to really foul things up you need a computer. (tags: linux networking dhcp hostname dns) [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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