Linux network configuration files 

Joined:
01/15/2009
Posts:
89

May 15, 2011 14:18:54    Last update: May 15, 2011 14:19:49
  1. /etc/resolve.conf: DNS server configuration.

    Example:
    search localdomain
    nameserver 192.168.183.2
    

  2. /etc/hosts: map hostname to IP address locally instead of using DNS, often take precedence over DNS.

    Example:
    127.0.0.1	localhost
    127.0.1.1	myserver
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    

  3. /etc/nsswitch.conf: system databases and Name Service Switch configuration file.

    Example:
    # /etc/nsswitch.conf
    #
    # Example configuration of GNU Name Service Switch functionality.
    # If you have the `glibc-doc-reference' and `info' packages installed, try:
    # `info libc "Name Service Switch"' for information about this file.
    
    passwd:         compat
    group:          compat
    shadow:         compat
    
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    networks:       files
    
    protocols:      db files
    services:       db files
    ethers:         db files
    rpc:            db files
    
    netgroup:       nis
    

  4. /etc/sysconfig/network (for Fedora, Redhat, CentOS): specify network configuration - static IP, DHCP, NIS, etc.
  5. /etc/network/interfaces (for Ubuntu): specify network configuration - static IP, DHCP, NIS, etc.

    Example:
    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet dhcp
    
    auto eth1
    iface eth1 inet static
    address 192.168.183.5
    netmask 255.255.255.0
    gateway 192.168.183.2
    


Share |
| Comment  | Tags