/etc/hosts
A system file that maps host names to IP addresses on one machine, checked before or instead of DNS.
In more detail
Adding a line such as 127.0.0.1 staging.local makes that name resolve to your own machine. The file belongs to root, so editing it needs sudo.
Related terms
- DNS — The system that turns names such as learnsome.tech into IP addresses.
- localhost — The name a machine uses for itself; traffic sent there never leaves that machine.
- tee — A command that copies its standard input both to one or more files and to its standard output.
Taught in
- Pipelines, tee And Process Substitution — Bash Scripting & Command Line Automation