The following files are used to store networking information.
/etc/resolv.conf
contains a list of DNS servers
nameserver 192.168.1.108 nameserver 192.168.1.1 search linuxit.org
/etc/HOSTNAME or
/etc/hostname is used to give a name to the PC
One can also associate a name to a network interface. This is done in differently across distributions.
/etc/hosts contains
your machine's IP number as well as a list of known hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost localhost.localdomain # other hosts 192.168.1.108 mesa mesa.domain.org 192.168.1.119 pico
/etc/sysconfig/network defines if
networking must be started. (can also contain the HOSTNAME variable)
NETWORKING=yes HOSTNAME=mesa.domain.org GATEWAY=192.168.1.1 GATEWAYDEV=
/etc/sysconfig/network-scripts/ifcfg-eth0
The configuration parameters for eth0
DEVICE=eth0 BOOTPROTO=none BROADCAST=192.168.1.255 IPADDR=192.168.1.108 NETWORK=192.168.1.0 ONBOOT=yes USERCTL=no
/etc/network/options is used on
Debian-based distributions to hold general networking
options
/etc/network/interfaces is used on
Debian-based distributions to hold interface configuration information.
# configure the loopback interface
auto lo
iface lo inet loopback
# configure the Ethernet interface and gatewat
auto eth0
iface eth0 inet static
address 192.168.1.108
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1