2

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!

Arpit Tambi
  • 471
  • 3
  • 5
  • 11

3 Answers3

3

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

Rowland Shaw
  • 494
  • 1
  • 9
  • 19
  • 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 03 '09 at 09:45
  • I think I need BIND and they have a manual too. Lets see if that works. Thanks. – Arpit Tambi Jul 03 '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 03 '09 at 11:27
2

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

Cian
  • 5,777
  • 1
  • 27
  • 40
0

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

LapTop006
  • 6,466
  • 19
  • 26