Chapter 11. Network Interfaces
/etc/sysconfig/network-scripts/directory. The scripts used to activate and deactivate these network interfaces are also located here. Although the number and type of interface files can differ from system to system, there are three categories of files that exist in this directory:
- Interface configuration files
- Interface control scripts
- Network function files
11.1. Network Configuration Files
- 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
DNSserver. Regardless of the type of network the computer is on, this file should contain a line specifying the
IPaddress of the loopback device (
localhost.localdomain. For more information, see the
- This file specifies the
DNSservers and the search domain. Unless configured to do otherwise, the network initialization scripts populate this file. For more information about this file, see the
- 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”.
- For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface. See Section 11.2, “Interface Configuration Files” for more information on this type of file and the directives it accepts.
/etc/sysconfig/networking/directory is used by the now deprecated Network Administration Tool (
system-config-network). Its contents should not be edited manually. Using only one method for network configuration is strongly encouraged, due to the risk of configuration deletion. For more information about configuring network interfaces using graphical configuration tools, see Chapter 10, NetworkManager.
11.1.1. Setting the Host Name
/etc/sysconfig/networkfile. For example:
/etc/sysconfig/network, or by the
/etc/hostsfile. The default setting of
hosts: files dnsin
/etc/nsswitch.confcauses the configuration files to be checked before a resolver. The default setting of
multi onin the
/etc/host.conffile means that all valid values in the
/etc/hostsfile are returned, not just the first.
/etc/hostsfile instead of the HOSTNAME directive in
/etc/sysconfig/network, for example, when DNS is not running during system bootup.
/etc/hostsfile, add lines to it in the following format:
192.168.1.2 penguin.example.com penguin