Hi List;
Where do I change the hostname for a machine running Fedora 7?
On Wed, 27 Jun 2007 13:02:26 -0600 Kevin Kempter kevin@kevinkempterllc.com wrote:
Where do I change the hostname for a machine running Fedora 7?
/etc/sysconfig/network
HOSTNAME=
Kevin Kempter wrote:
Hi List;
Where do I change the hostname for a machine running Fedora 7?
---cut--- #!/bin/sh
user=`id -u`
if [ $user != 0 ] then echo "Must be root to execute: $0" exit fi
HOST=`hostname`
echo -n "Enter the new Host Name: " read garb
echo "g/${HOST}/s//${garb}/g w q " > /tmp/doed
list="/etc/hosts /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth?"
for name in $list do echo "editing $name" ed $name < /tmp/doed hostname $garb done ---cut---
Kevin Kempter
Where do I change the hostname for a machine running Fedora 7?
Phil Meyer:
---cut--- #!/bin/sh
man hostname "hostname - show or set the system’s host name"
Does the already provided "hostname" command not work for you?
On Fri, 29 Jun 2007 06:36:20 +0930 Tim ignored_mailbox@yahoo.com.au wrote:
"hostname - show or set the system’s host name"
Does the already provided "hostname" command not work for you?
hostname doesn't make permanent changes. Just like ifconfig, when you reboot everything goes back to what it was before.
Phil Meyer wrote:
Kevin Kempter wrote:
Hi List;
Where do I change the hostname for a machine running Fedora 7?
list="/etc/hosts /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth?"
I think this clobbers the 'localhost' entry in /etc/hosts if the hostname hasn't already been set. (if that's the case then check /etc/hosts still has localhost in the line 127.0.0.1 localhost.localdomain localhost