Tuesday, July 27, 2010

Network services in RHEL-resolv.conf,network,hosts


1: setting DNS for your server:

# vim /etc/resolv.conf
search example.com
nameserver  172.16.2.121

2:setting a local dns using /etc/hosts

# vim /etc/hosts
IP Address     Hostname           Alias

127.0.0.1     Localhost          Gate.openarch.com
208.164.186.1   gate.openarch.com Gate

3:setting hostname for server

# vim /etc/sysconfig/network
NETWORKING=yes
Gateway=…….
# service network restart

4: Setting DHCP or statics IP

# ifconfig
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
onboot=yes
Bootproto=DHCP or Static
IPADDR=
Netmask=
gateway=
#ifdown eth0
#ifup eth0