Configure Linux Hostname

Config

If you want to change your Linux hostname and you’re running Fedora or Red Hat, the steps are listed below.

Immediate Change

echo 'some.host.com' > /proc/sys/kernel/hostname

Persisted Change

This is for non-DHCP nodes.

Add your name to /etc/sysconfig/network

NETWORKING=yes
HOSTNAME="some.host.com"

If you’re node gets an IP address from a DHCP server then you can set:

DHCP_HOSTNAME="some.host.com"

in the /etc/sysconfig/network-scripts/ifcfg-eth0 file (or whatever your primary device is).

Notes

You can also add your hostname to your /etc/hosts file

10.1.1.10 some.host.com some
No Comments

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>