views:

341

answers:

9

Is anyone aware of a public wildcard domain name that resolves to IP address 127.0.0.1. For example if I wanted to test a URL locally such as mywebsite.localhost.com or example.localhost.com but I don't have control of DNS settings (hosts file or whatever) then I would use this public DNS to resolve to 127.0.0.1. It needs to be wildcarded so that no matter whatever comes before localhost.com it still resolves to 127.0.0.1.

A: 

Why not using the literal IP address in the URL?

  • http://127.0.0.1/ (old IPv4)
  • http://[::1]/ (new IPv6)
bortzmeyer
My particular problem is I'm using host headers in IIS. In addition I'm working on portal software which displays different content based on the URL requested.
Rahul
A: 

If you are using Windows DNS, you can create a new zone, then you DnsCmd to add A records for @ and *.

dnscmd /RecordAdd local * 3600 A 127.0.0.1
dnscmd /RecordAdd local @ 3600 A 127.0.0.1
Hafthor
+1  A: 

If nothing else, you could just register a domain for yourself and set it up so that's how it behaves.

Karl
+4  A: 

Hi,

This domain resolves to 127.0.0.1:

www.mouse-potato.com

Nick Sullivan
+1  A: 

somesite.com is the first one I knew about, however I found a whole bunch here

http://www.websiteoutlook.com/www.somesite.com

Check the 20 other sites point to 127.0.0.1. I have no idea how long these sites will stay pointing to 127.0.0.1.

Billy Foss
+1  A: 

You can go to http://afraid.org and register one.. You can get free domains(well subdomains, but you have complete control over A and NS and such records) and point one at 127.0.0.1. They support wild-cards

Earlz
@Earlz :) 127.0.0.1 is not the universal IP address to Rahul's house. That would resolve to local host on the DNS server at afraid.org.
orokusaki
@oro What he is looking for then is a dynamic IP service. I understood from the question that he wanted just a domain that pointed at 127.0.0.1 which would be the IP of the person that is browsing the domain.
Earlz
@Earlz Give that a try and see how it works. Look up how DNS works, and you'll understand why it's impossible.
orokusaki
Why would it be impossible.. It's just a pointer, it's very well possible to have an A record pointing to 127.0.0.1.
Arda Xi
+1  A: 

Your hosts file in C:\WINDOWS\system32\drivers\etc ought to be able to do this, just add one single line like this:

127.0.0.1 www.mydomain.com

Additionally, use a server like apache or a program with it like wamp, and just go to http://localhost

Cyclone
I don't see why anyone downvoted this answer. This is the best answer here. What the OP is asking is impossible.
orokusaki
Maybe because he says " I don't have control of DNS settings (hosts file or whatever) "?
Arda Xi
+1  A: 
Roger Pate