• 26Mar

    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.

    Posted by keith @ 12:03 am

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.