rename localhost
July 17, 2013
If you’re doing web development locally, you’re probably navigating to
localhost:XXXX a lot. I got annoyed with having to type out “localhost”
all the time so I created a new domain, “lh”, that does the same thing. This
way you can type lh:3000
rather than localhost:3000
. It’s a small optimization,
but a convenient one if you’re a web developer.
To make the change, open up a terminal and run:
(replacing vim with your favorite command line editor, ie. vim, emacs, nano, etc.)
Then add 127.0.0.1 lh
to the end of the file. The result for me looks like:
you may need to flush the DNS cache now. On Snow Leopard[1], you can do that with:
Now sit back and bask in the glory of 7 fewer keystrokes.