Super User is a question and answer site for computer enthusiasts and power users. 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 was wondering if I could use my Windows 7 hosts file to create shorter URLs for sites? OR is there another way. I tried ones like the following but I'm guessing it only works with IP Addresses? goog

OR goog.le (didn't really use this just another example)

share|improve this question
Is this so you don't have to type so much? Modern browsers' url/search bars already have this shortcut capability. – Ben Richards Apr 4 '12 at 14:28
up vote 5 down vote accepted

Unless you're willing to get the IP address for every site you wish to shorten. It's not very feasible, but it works.

Edit your hosts file and input as follows: goog

If you go into your web browser and type goog, goes directly to that IP.

It works if you wanna go straight to the IP, but if you're looking to input entire URLs, it's not a feasible solution and it's not going to work.

share|improve this answer
Thanks this works! – fwaokda Apr 4 '12 at 14:39

The hosts file only is suitable for mapping hostnames to IP adresses, thus it can't be used for this purpose.

A workaround can be creating bookmarks named after the "keywords" you want to use. E.g. a bookmark called 'goog' that redirects to With a service like Xmarks, it can be used across browsers.

share|improve this answer

If you are using the URL as a link, you can substitute a shorter URL with one of the common sites that take a long url and host a smaller, but cryptic url. Examples are Bitly and tinyUR. These are the type of truncations most blog posts use.

share|improve this answer

Also note another limitation of the host file approach: it breaks HTTP protocol version 1.1 (and above) virtual host functionality. Virtual host feature of HTTP protocol means you can have multiple host names handled by the same IP address. This works by the HTTP client (browser) inserting Host: header in the HTTP request. If you use shortened name, even if the request goes to the right IP address, the Host: field will have your shortened host name which will likely not be recognized by the HTTP server and you will not receive the expected page in this case.

Also I would expect breakage of secure HTTP (SSL) with this approach.

share|improve this answer

You can use to create DNS aliases, which would do exactly what you want, see screenshot.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .