Socket Programming Question:

What is the /etc/hosts File?

Tweet Share WhatsApp

Answer:

The correspondence between host names and IP addresses is maintained in a file called hosts in the (top-level) directory /etc. On most systems, any user can read this file. (A word of caution: on many systems, printing this file may be injurious to local paper supply!!)

Entries in this file look like the following:

127.0.0.1 localhost
192.217.44.208 snoopy beagle hound metlife
153.110.34.18 bugs wabbit wascal
153.110.34.19 elmer
153.110.34.20 sam

Note that more than one name may be associated with a given IP address. This file is used when converting from IP address to host name and vice versa.

Download Socket Programming PDF Read All 62 Socket Programming Questions
Previous QuestionNext Question
What is Network Host Names?How to Selecte a Service Port?