1. The phenomenon of problems
Host name (hostname) is displayed as unknown
2. How to Solve
My environment is for unknown, one is not set host name, two are using DHCP assigned IP mode
The workaround steps are described below:
First procedure: Modifying the hostname configuration file and creating a new node file
Vi/etc/hosts
bash-3.00# cat/etc/hosts
#
# Internet Host Table
#
:: 1 localhost
127.0.0.1 localhost
192.168.1.111 Devin-wu-svr # Added by DHCP
Vi/etc/nodename
Vi/etc/hostname.e1000g0
bash-3.00# Cat/etc/nodename
Devin-wu-svr
Vi/etc/hostname.e1000g0
bash-3.00# cat/etc/hostname.e1000g0
Devin-wu-svr
Second procedure: Configuring a network gateway, default route
Vi/etc/netmasks
bash-3.00# Cat/etc/netmasks
#
# The Netmasks file Associates Internet Protocol (IP) address
# Masks with IP network numbers.
#
# Network-number Netmask
#
# The term network-number refers to a number obtained from the Internet network
# information Center.
#
# Both The Network-number and the netmasks are specified in
# "Decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
192.168.1.0 255.255.255.0
Vi/etc/defaultrouter
bash-3.00# Cat/etc/defaultrouter
192.168.1.1
The third process: Reboot reboot the system to make it effective.
References: http://www.linuxdiyf.com/viewarticle.php?id=106062