Setting a Static IP and DNS on CentOS
On CentOS, edit the ifcfg-eth0 network configuration file to set a static IP, netmask, and gateway, configure DNS in /etc/resolv.conf, then restart the network interface. This article provides a complete configuration example.