If you want to learn how to open up the hosts file, read on. A hosts file defines any and all hostnames that aren't in the domain name system, in fact, one can even override the DNS by changing the hosts file (as it has priority).
It would also be possible to use the hosts file to declare these. In the case of and localhost, they both use system called DNS (domain name system) which - to really water things down - tells the computer where they point to. But how does your computer know which IP address a hostname points to? Perhaps the most-commonly used example of a hostname is localhost which is actually just a hostname for 127.0.0.1.
If we think about the IP address as the host, and the domain as the name, it's quite clear to see where the name 'hostname' comes from: it's the name for a host. When you visit a website, for example Save Location, the domain (in this case, ) is just an alias for an IP address.