Wildcard *.local hosts to apache on OS X

apache-2.2domain-name-systemhostslocal

I would like to route all my *.local or *.dev domains to a specific IP, either the IP of my Ubuntu VM or localhost. Is this possible? Can I use the /etc/hosts file?

I am running Mac OS X Snow Leopard with Ubuntu Hardy Heron LTS – JeOS on VMware Fusion 3.

Right now I just keep making /etc/hosts records for each one and I would rather it be like wildcard DNS and let Apache handle the domains then manually entering it each time. I like the flexibility to update this when I do something odd or someone gives me a strange request but 90% of it I think would be best automated.

Best Answer

Unfortunately you can not add wildcard entries to /etc/hosts file. That being said This Article demonstrates a method that works with Tiger. Although I think launchctl is deprecated as of leopard but it may still work.

Related Topic