up vote 1 down vote favorite
share [g+] share [fb]

For local testing (and learning), I wish to use x.com host name instead of localhost. I changed my Windows XP host file to this -

127.0.0.1       x.com

Now http://x.com/ works beautifully but http://www.x.com doesn't. :(

What changes should I make so that www.x.com, sub1.x.com, sub2.x.com etc.. all work on local. Using WordpressMU users will be able to create and manage sub-domains dynamically.

I am basically trying to setup WordpressMU locally. I'm using Apache/2.2.4, PHP/5.2.4, and MySQL5.

Please help!

link|improve this question

57% accept rate
feedback

3 Answers

up vote 2 down vote accepted

You've changed the IP for a single host x.com - You might be better off installing a local DNS server, and configuring the zones as you require (for instance, you could push email through a different MTA)

The quick solution would just be to add additional lines like: 127.0.0.1 www.x.com 127.0.0.1 sub1.x.com

link|improve this answer
Okay, so I need to a) Install a local DNS server and b) setup some zones there. I would be grateful if you could suggest me a windows dns server and a link/book that tells me how to do all this crazy stuff. I'm excited :D – Arpit Tambi Jul 3 '09 at 9:45
I think I need BIND and they have a manual too. Lets see if that works. Thanks. – Arpit Tambi Jul 3 '09 at 10:11
I've certainly used Bind in the past -- mostly because that's what I use in production, so I could easily migrate the zone files... – Rowland Shaw Jul 3 '09 at 11:27
feedback

Unfortunately, this will require setting up a local DNS server, with zone files for these domains, as it's not possible to use wildcard domains in /etc/hosts

link|improve this answer
feedback

As Rowland said, what you're asking for is wildcard DNS, and that requires a real DNS server.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.