links
You can change the network configuration by editing a few files.
1. CentOS & RedHat OS
Host Name : /etc/sysconfig/network
Network Device : /etc/sysconfig/networking/devices/ifcfg-eth0 ifcfg-eth1
Host Name List : /etc/hosts
DNS Server : /etc/resolve.conf
DNS Files NIS : /etc/nsswitch.conf
After editing files, you need to execute the follwoing command :
| # service network restart |
2. ubuntu
Network Interface : /etc/network/interfaces
Exsample:
| # The primary network interface – use DHCP to find our address auto eth0 iface eth0 inet dhcp |
| # The primary network interface
auto eth0 |
DNS Server : /etc/resolv.conf
After editing files, you need to execute the follwoing command :
| # sudo /etc/init.d/networking restart |