Exercises

  1. The “hosts” file on most machines consists of a set of lines.

    (The “hosts” file is located in /etc/hosts on UNIX and Linux machines; in C:\WINDOWS\HOSTS on Windows 95 and Windows 98 machines; and in C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS on Windows NT, 2000, and XP.

    You may not find a HOSTS file on all Microsoft Windows machines, but you will find one on all UNIX and Linux machines. A bit of advice for Windows users: if you don’t manage to locate a HOSTS file, try to find HOSTS.SAM.)

    Each line lists an IP address, a host name, and an optional set of aliases. A typical hosts file looks like the following:

    192.168.0.1     www.pfc.com pcf.com 
    192.168.0.2     micky micky.pfc.com mailhost 
    192.168.0.3     loghost secure.pcf.com 
    127.0.0.1       localhost

    Ignore ...

Get Perl for C Programmers 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.