Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Ubuntu Desktop 12.04 and would like to be able to open a web browser (Firefox), type an alias into the address bar, hit enter, and have the browser take me to the site that the alias references. For instance, I'd like to be able to type in "so" and have it take me to, etc.

I realize this is what "Favorties" or "Bookmarks" already do, however, this is like the text-only, command-line version of those tools.

I suspect I have to configure something equivalent to a Windows HOST file, but since I'm so new to Linux/Ubuntu, I don't know what that equivalent is, or if this is even possible to do. Thanks in advance!

share|improve this question
up vote 2 down vote accepted

If you did this with the hosts file, you would have to use the IP address of the websites in question, which would probably be a bad idea. IP addresses change, aand most larger sites use several different IPs in a round-robin/load-balancing configuration. At any rate, to do that, just edit the /etc/hosts file, and add lines similar to this:

# alias for    so

That first line is just a comment, so you know what it's doing there later.

If you just want to have aliases for Firefox, there is an add-on called URL Alias. Just search for it in the add-ons for Firefox. The Alias Links extension in Chrome will do the same thing.

share|improve this answer

You can't do what you want using the /etc/hosts file, because it simply maps names to IP addresses. It does not perform HTTP redirects, which is what you are really after.

While it may work for some sites, many others (e.g. sites hosted on a shared IP) will not.

This page has some good reading material regarding the hosts file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.