To add a host to a local network, follow these steps:
Assign a unique IP address and host name;
Sets the network interface of a new host when it is started;
Set a default route. More routing configurations may be available;
Point to a DNS name server and allow access to other parts of the Internet.
1. Allocate host names and IP addresses
Edit the/etc/hosts file
127.0.0.1 localhost. localdomain hostname. localdomain localhost hostname
10.1.8.176 hostname. localdomain
2. Configure Network Interfaces
Ifconfig eth0 10.1.8.176 netmask 255.255.255.0 broadcast 10.1.8.255 up
Use netstat-I to find the Interface Name
View Interface Configuration with/sbin/ifconfig eth0
3. Configure routes
Route add-net 10.1.8.0 netmask 255.255.255.0 gw 10.1.8.1 eth0
Route add default gw 10.1.8.1 eth0
Use netstat-nr to view route configurations
4. Configure DNS
Edit the/etc/resolv. conf file
Nameserver 10.1.9.11
Nameserver 211.98.2.4
Up to three nameserver entries
View the Service Switch file/etc/nsswitch. conf and/etc/host. conf to confirm the domain name resolution sequence.
Most applications are connected to libc6. libc6 uses the BIND parser and the nsswitch. conf file. A few old applications are connected to libc4 or libc5. They use the/etc/host. conf file.
Default Value of the Service Switch File
Open the Customs document |
Default settings for host name search |
/Etc/nsswitch. conf |
Files nisplus nis dns |
/Etc/host. conf |
Hosts, bind |
Red Hat Network Configuration File
Text |
Set internal capacity |
/Etc/sysconfig/network |
Host Name and default route |
/Etc/sysconfig/static-routes |
Static Routing |
/Etc/sysconfig/network-scripts/ifcfg-Ifname |
IP address, network mask, broadcast address of each interface |