I’m trying to learn about hosts & apache a little bit. One of the things I’m trying to do myself is to add a line to /etc/hosts so that way I can access localhost in the browser
Currently, hosts contains this:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Questions:
1. What does the ::1, and fe80::1%lo8 mean?
2. Are they essential to the accessing of 127.0.0.1 via typing ‘localhost’ in your browser?
3. What would I do to create an additional link to 127.0.0.1 typing something else in the browser, like “local”, so that way both “localhost” and “local” work?
Kristian, I’m not sure what those symbols mean (::1 for example), but creating host file entries is as easy as typing an IP address and then the list of domains to match.
For example:
will match both ‘local’ and ‘localhost’ to 127.0.0.1. You could have also done the following:
One entry per line – use a ‘#’ at the beginning of each line if you want to comment that line out.