0

I was wondering the steps I can take to change the localhost name to a test development domain name like "website.dev" on Win7 x64 ? Currently, when my test website builds its assigned to 127.0.0.1:81 but I want this to instead have a name like "website.dev" that is accessible on my local network ?

[and sure any Virtual PCs built on this local PC]

I think this is done via the hosts file but I am little unsure how to do this ? Would someone be able to assist ?

Thx

  • 1
    you won't be able to affect the port through DNS, though there may be other options available, i don't know. at best, with DNS, you can do `website.dev:81` – cpbills May 19 '10 at 07:18
  • hi :) thanks for the response. any idea how i can do this ? –  May 19 '10 at 07:44

2 Answers2

1

Simple answer: services served on 127.0.0.1 are not reachable from external systems without some kind of redirector. The 127/8 subnet is the local host -- and every host has a local host subnet.

So you'll either need a port-redirection system which listens on your LAN IP and forwards traffic to the 127.0.0.1 service, or you will have to figure out how to get your service to listen on your LAN IP. With the former, you can have the listener listen on port 80 of your LAN IP, thus letting people connect without the :81 specification, with the latter you'd either have the service run on port 80 directly or people will still have to use :81.

Either way, you can then add a DNS record (probably a CNAME) that refers requests to your system's name/IP.

Unless you are serving up the .dev domain, you can't call it website.dev; but you can call it websitedev.yourdomain.

David Mackintosh
  • 14,293
  • 7
  • 49
  • 78
1

127.0.0.1/8, as everybody already said, is the local network, the computer itself. If you want to have a name different from localhost, you can edit the hosts file:

C:\windows\system32\drivers\etc\

There you can add/edit/delete all association between ips and names. Instead of using 127.0.0.1, you should use maybe a different ip, like the one assigned to your network card (192.168.0.1/24 for example).

PiL
  • 1,599
  • 8
  • 6