>_ IzzyLab

Topic breakdown

The /etc/hosts file is a local "IP → names" table that the resolver consults before DNS. The line format: first the address, then one OR more alias names separated by spaces, and they all resolve to that address — that is, several names for one IP go on a single line, separate entries aren't needed. The line is added to the end of the file with the append operator >> (two greater-than signs, so it appends instead of overwriting the existing content). The result is checked with getent hosts, which returns the resolution outcome taking this file into account.

What's checked

  1. three names resolve to 127.0.0.1
  2. the localhost entry is intact

What it looks like