1. /etc/hosts
2. /etc/sysconfig/network
3. Set hostname
echo "oel6.localdomain" > /proc/sys/kernel/hostname
4. Restart Network Service
service network restart
The primary network configuration files are as follows:
/etc/hosts
The main purpose of this file is to resolve host names that cannot be resolved any other way.
It can also be used to resolve host names on small networks with no DNS server.
Regardless of the type of network the computer is on, this file should contain a line specifying the IP address of the loopback device (127.0.0.1) as localhost.localdomain.
/etc/resolv.conf
This file specifies the IP addresses of DNS servers and the search domain. Unless configured to do otherwise, the network initialization scripts populate this file. For more information about this file, see the resolv.conf(5) manual page.
/etc/sysconfig/network
This file specifies routing and host information for all network interfaces. It is used to contain directives which are to have global effect and not to be interface specific. For more information about this file and the directives it accepts, see Section D.1.13, “/etc/sysconfig/network”.
/etc/sysconfig/network-scripts/ifcfg-interface-name
For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface.
To permanently change the static host name, change the HOSTNAME directive in the /etc/sysconfig/network file. For example:
HOSTNAME=oel641.sg.com
To change the host name using the /etc/hosts file, add lines to it in the following format:
192.168.1.1 oel641.sg.co.in oel641
i.e.
# Public
192.168.1.101 oel641.sg.co.in oel641
192.168.1.102 oel642.sg.co.in oel642
# Virtual
192.168.1.103 oel641-vip.sg.co.in oel641-vip
192.168.1.104 oel642-vip.sg.co.in oel642-vip
# Private
192.168.2.101 oel641-priv.sg.co.in oel641-priv
192.168.2.102 oel642-priv.sg.co.in oel642-priv
# SCAN
192.168.1.105 oel64-scan.sg.co.in oel64-scan
192.168.1.106 oel64-scan.sg.co.in oel64-scan
192.168.1.107 oel64-scan.sg.co.in oel64-scan
192.168.1.1
oel6.localdomain
oel6
2. /etc/sysconfig/network
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME="oel6.localdomain"
GATEWAY="192.168.1.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"
3. Set hostname
echo "oel6.localdomain" > /proc/sys/kernel/hostname
4. Restart Network Service
service network restart
The primary network configuration files are as follows:
/etc/hosts
The main purpose of this file is to resolve host names that cannot be resolved any other way.
It can also be used to resolve host names on small networks with no DNS server.
Regardless of the type of network the computer is on, this file should contain a line specifying the IP address of the loopback device (127.0.0.1) as localhost.localdomain.
/etc/resolv.conf
This file specifies the IP addresses of DNS servers and the search domain. Unless configured to do otherwise, the network initialization scripts populate this file. For more information about this file, see the resolv.conf(5) manual page.
/etc/sysconfig/network
This file specifies routing and host information for all network interfaces. It is used to contain directives which are to have global effect and not to be interface specific. For more information about this file and the directives it accepts, see Section D.1.13, “/etc/sysconfig/network”.
/etc/sysconfig/network-scripts/ifcfg-interface-name
For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface.
To permanently change the static host name, change the HOSTNAME directive in the /etc/sysconfig/network file. For example:
HOSTNAME=oel641.sg.com
To change the host name using the /etc/hosts file, add lines to it in the following format:
192.168.1.1 oel641.sg.co.in oel641
i.e.
# Public
192.168.1.101 oel641.sg.co.in oel641
192.168.1.102 oel642.sg.co.in oel642
# Virtual
192.168.1.103 oel641-vip.sg.co.in oel641-vip
192.168.1.104 oel642-vip.sg.co.in oel642-vip
# Private
192.168.2.101 oel641-priv.sg.co.in oel641-priv
192.168.2.102 oel642-priv.sg.co.in oel642-priv
# SCAN
192.168.1.105 oel64-scan.sg.co.in oel64-scan
192.168.1.106 oel64-scan.sg.co.in oel64-scan
192.168.1.107 oel64-scan.sg.co.in oel64-scan
No comments:
Post a Comment