Skip to content

Instantly share code, notes, and snippets.

@lenosi
Last active October 26, 2017 09:16
Show Gist options
  • Save lenosi/801576776b19f8a5b3e28247d54da9d3 to your computer and use it in GitHub Desktop.
Save lenosi/801576776b19f8a5b3e28247d54da9d3 to your computer and use it in GitHub Desktop.
Dynamic DHCP based hostname on RHEL and CentOS systems

RHEL & CentOS 6

Edit/Add HOSTNAME in /etc/sysconfig/network to 'HOSTNAME=localhost'
service network restart

RHEL & CentOS 7

Edit /etc/hostname to localhost
systemctl restart network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment