Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

3 Answers 3

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

share|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

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

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.