hostname change..

and the next thing is the hostname.

Permanent hostname change on RedHat based systems

RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit

/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=”plain.domainname.com”
GATEWAY=”192.168.0.1?
GATEWAYDEV=”eth0?
FORWARD_IPV4=”yes”

So in order to preserve your change on system reboot edit this file and enter the appropriate name using the HOSTNAME variable. Use sysctl to change the hostname

Why would someone need a different method of doing the same thing as above? No idea, but here is anyway: use sysctl to change the variable kernel.hostname: Use:

sysctl kernel.hostname

to read the current hostname, and

sysctl kernel.hostname=NEW_HOSTNAME

to change it.

Related Post

2 Responses

  1. namran says:

    4) Module parameters.
    ———————
    The following module parameters can be passed:

    mode=

    Possible values are 0 (round robin policy, default) and 1 (active backup
    policy), and 2 (XOR). See question 9 and the HA section for additional info.

    miimon=

    Use integer value for the frequency (in ms) of MII link monitoring. Zero value
    is default and means the link monitoring will be disabled. A good value is 100
    if you wish to use link monitoring. See HA section for additional info.

    downdelay=

    Use integer value for delaying disabling a link by this number (in ms) after
    the link failure has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    updelay=

    Use integer value for delaying enabling a link by this number (in ms) after
    the “link up” status has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    arp_interval=

    Use integer value for the frequency (in ms) of arp monitoring. Zero value
    is default and means the arp monitoring will be disabled. See HA section
    for additional info. This field is value in active_backup mode only.

    arp_ip_target=

    An ip address to use when arp_interval is > 0. This is the target of the
    arp request sent to determine the health of the link to the target.
    Specify this value in ddd.ddd.ddd.ddd format.

    If you need to configure several bonding devices, the driver must be loaded
    several times. I.e. for two bonding devices, your /etc/conf.modules must look
    like this:

    alias bond0 bonding
    alias bond1 bonding

    options bond0 miimon=100
    options bond1 -o bonding1 miimon=100

    Reply
  2. namran says:

    4) Module parameters.
    ———————
    The following module parameters can be passed:

    mode=

    Possible values are 0 (round robin policy, default) and 1 (active backup
    policy), and 2 (XOR). See question 9 and the HA section for additional info.

    miimon=

    Use integer value for the frequency (in ms) of MII link monitoring. Zero value
    is default and means the link monitoring will be disabled. A good value is 100
    if you wish to use link monitoring. See HA section for additional info.

    downdelay=

    Use integer value for delaying disabling a link by this number (in ms) after
    the link failure has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    updelay=

    Use integer value for delaying enabling a link by this number (in ms) after
    the “link up” status has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    arp_interval=

    Use integer value for the frequency (in ms) of arp monitoring. Zero value
    is default and means the arp monitoring will be disabled. See HA section
    for additional info. This field is value in active_backup mode only.

    arp_ip_target=

    An ip address to use when arp_interval is > 0. This is the target of the
    arp request sent to determine the health of the link to the target.
    Specify this value in ddd.ddd.ddd.ddd format.

    If you need to configure several bonding devices, the driver must be loaded
    several times. I.e. for two bonding devices, your /etc/conf.modules must look
    like this:

    alias bond0 bonding
    alias bond1 bonding

    options bond0 miimon=100
    options bond1 -o bonding1 miimon=100

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *