So if you ever have a need to set the hostname of a newly provisioned Red Hat style box from your reverse dns PTR record that you’ve assigned to that machine (ideally through DHCP) here you go:
sed -i s/localhost.localdomain/`host \`ifconfig eth0 | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}'\` | awk '/pointer/{print $5}' | sed s/\.$//`/ /etc/sysconfig/network
Swap out the eth0 for whichever port is your primary.
