Skip navigation.
Home

Week of February 27, 2006 to March 05, 2006

Windows XP, wildcard DNS and localhost subdomains

Well, I killed a whole day yesterday, trying to find a way to setup a wildcard DNS entry for my localhost. So, I'm running on my Windows XP all the stuff needed for web developing - simple web server (Abyss web server by Aprelium - really cool little server that is a breeze to manage), php and mysql. Everything is working ok. When you enter http://localhost or http://127.0.0.1, or http://192.168.7.2/ (which is my comp IP in the local network) in the browser, it takes you to the web server htdocs where your html, php scripts and whatever else web files are stored. But, you know, I wanted that each possible subdomain like http://anything.localhost goes to the http://localhost htdocs folder too... Man, it was hard to achieve for an idiot like me, who has never dealt with DNS :) Probably it's a very unique task that I wanted to achieve, because I didn't find a straightforward tutorial that would help me. About noon yesterday I had some kind of success. I could map different domains for my localhost in the C:/Windows/System32/Drivers/etc/hosts file. So, if you add lines there like these: 127.0.0.1 subdomain.localhost 127.0.0.1 yahoo.com both of them (even the yahoo.com) would take you to the localhost. BUT, that's not exactly what I wanted because that way I should have entered all the subdomains that I needed manualy. I needed a solution that would catch http://any-possible-subdomain.localhost without being entered before in the hosts file. In the eary evening I was convinced that I need a DNS server in which I have to set up a wildcard entry for my localhost. Google told me that TreeWalk might be something that I need. This software installed a C:\WINDOWS\system32\dns\etc\ folder on my pc. There was a file called localhost there. All I had to do is add this line: *.localhost. IN A 127.0.0.1 restart Treewalk and Ta-Daaaa. I was able to access my localhost with any possible subdomain... I really don't remember where I've read the line above, but it proved to be very useful :) So, adding a wildcard DNS on Windows XP for the localhost could be quite easy, if there was a proper tutorial somewhere, but there wasn't. I hope that at least one or two would find these writings useful.
Week of February 27, 2006 to March 05, 2006 | TheHidden.INFO
Skip navigation.
Home

Week of February 27, 2006 to March 05, 2006

Week of February 27, 2006 to March 05, 2006 | TheHidden.INFO
Home

Week of February 27, 2006 to March 05, 2006