Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

How can I create a domain name for local purposes?

for example I have a local web application enviroment in http://localhost:8000 but I would like to have it in http://dev instead.

I am using Ubuntu 10.04

share|improve this question
Used parenthesis between http because, due my low reputation was not posible to post more than one link. – juanefren Aug 2 '10 at 21:51
You just have to format the URLs as code like Lawrence did for you. – Felix Aug 2 '10 at 22:19
up vote 2 down vote accepted

You should be able to use a text editor of your choosing to edit your /etc/hosts file. Add two entries that look like this:   dev
::1         dev

These hosts entries map the "dev" hostname to your machine's loopback interface (address under IPv4, and 0:0:0:0:0:0:0:1 for IPv6). After saving, "http://dev" should behave identically to "http://localhost".

(NB: You will need superuser permissions to edit the /etc/hosts file.)

share|improve this answer
aliases are the better way: localhost dev - this way applications that rely on the name(!) localhost will still work and http:/dev will too. The port is another issue.. – matthias krull Aug 2 '10 at 22:21
I do not believe having multiple entries for affects the use of "localhost". – Lawrence Velázquez Aug 3 '10 at 1:50
i agree, multiple entries for is fine – bryan Aug 4 '10 at 5:22

I'm running DNSMasq for this kind of thing. It has DHCP server too.

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.