• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

hostname setting resets when computer does

DougK62

Diamond Member
I want my hostname to be set whenever I reset the computer. I'm using RH7.0. I know this can be done easily, but I don't know what file to put the command in - help? Thanks.

 
is it the hostname thats resseting or the domain name?

you can set the hostname by typing "hostname xxxxxx"

domain name can be set to survive a reboot by:

In etc/sysconfig/network add in the following lines:

NISDOMAIN='mydomainname.com'

In /etc/rc.sysinit add in the following lines:

# Set the NIS domain name
if [ -n "$NISDOMAIN" ]; then
action "Setting NIS domain name $NISDOMAIN" domainname $NISDOMAIN
else
domainname ""
fi

Right after the lines:

# Set the hostname.
action $"Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
 
under Debian, all you have to do is edit /etc/hostname. There is a script, /etc/init.d/hostname.sh, that will source that file and set the hostname. You might have something similar, but I'm not sure where yours will be (/etc/rc.d/init, maybe??)
 
Back
Top