Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not even 100% sure how to ask this question. The answer might be out there, but I can't find it.

So I've set up virtual hosts for my Mac and I do all my development locally on my computer. I have a vhost folder in my Sites folder, and I have a list of folders, such as:

and in my /etc/hosts file I have an entry for each one:

# vhosts
# ...    

And this works great. When I go to in my browser, it shows the contents of the ~/Sites/vhosts/

So this is my question: Is there a way to have any address that end in .cam to redirect to localhost? So I don't have to create a new entry in hosts every time I add a new directory (it happens pretty often).

I tried *.cam in my hosts file, but it didn't work :-/

share|improve this question

You could install a local DNS server/resolver (e.g. BIND) with a .cam zone containing a wildcard entry and have your resolv.conf point to localhost. The other requests you can either forward to your normal DNS resolver, or resolve them using the root servers.

share|improve this answer
Is there a Mac version of this sort of software? Any good tutorials on how to set it up? – CWSpear May 5 '12 at 5:04
BIND is portable, I don't think it is a problem getting it to work on MacOS. But I'm no mac user, so I cannot really help you with that. Google for something like "Install BIND on MacOS". – Oliver May 5 '12 at 19:49

Your Answer


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.