USING THE /etc/inet/hosts FILE

The /etc/inet/hosts file is the most basic and oldest hostname resolution method. It was used for quite some time on the Internet. Now it is used only for small private networks. The /etc/inet/hosts is a simple text file. Each line in this file represents one entry for a hostname. Lines starting with hash symbol (#) are comment lines. Each line starts with the IP address followed by the hostname. The last part of the line is optional and it is used to represent aliases for the hostname. A typical file is shown here:

# 
# Internet host table 
# 
127.0.0.1       localhost 
192.168.2.222   fana    loghost 
192.168.2.11    laptop 
192.168.2.1     desktop 
192.168.29.28   fana-nt 
192.168.30.30   kaka 

During the hostname resolution, lines are ...

Get Solaris™ 8 Network Administrator Certification Training Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.