One of you contacted me recently with a few questions regarding my previous post, Network File System (NFS) : Ubuntu (6.06.1 / 6.10). I wanted to post some follow up information on that to help clarify a few of the steps. Some of this may be very simple for many of you, for others it will hopefully open your eyes to a few more powerful aspects of an Ubuntu Linux system. Here goes.
Question: How did you modify the /etc/hosts file to use the ‘media’ shortcut?
Editing the /etc/hosts file is really simple and you can do quite a bit with it. Ever wish you could simple visit “mysite” in your browser and it’d know where you wanted to go? Ever wish you could give nicknames to your local network machines instead of trying to remember the IP address? Here is the place to do it.
To edit the file you would want to use a quick command within a terminal:
sudo gedit /etc/hosts
Simply add a line to your /etc/hosts file to create a network shortcut using the following syntax: ip.address shortcut. Example (on my network):
127.0.1.1 notebook.local notebook
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
The three lines in italics are my additions. You can use the same syntax to update your /etc/hosts file and go wherever you want! The above is an example of using a shortcut for the local network but the same goes for the outside world. Try something like:
…and the next time you type “42” in your browser it’ll come right up with google (yes, the answer to life, the universe and everything!), or put in “bestsiteever” and come right back here for some more great tutorials!