The hosts file is a way to map hostnames to IP addresses. This is very important with certain setups and to make networking on Linux a bit easier. In a sense, the hosts file acts as a local DNS server.
sudo nano /etc/hosts
For example, to block Wikipedia, you’d type (remembering to use the Tab key rather than Space):
or static dns lookup for hostnames