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 would like to know how to configure my VPS so that it's only accessible using, and not Anyone know how to do this?

share|improve this question

Point the A record else where and the www. at your servers IP address.

A better option would be to 301 redirect the to the so if a user types in it shows as

share|improve this answer
the reason I'm doing this is so that clients who I build sites for cannot see the sites until they are final. therefore, I cannot have simply redirect to - i need to show a 'page not found', while i test using something like – Cooper Maruyama Nov 2 '12 at 19:27

SImple: do not define an IP address for, only one for

share|improve this answer
this didnt work - i think vhost config needs to be adjusted. I tried changing ServerName to ServerName which also did not work. – Cooper Maruyama Nov 2 '12 at 21:37
It does work. You also need to change the ServerName but the right thing to do is to have no address record for in the DNS. So, two things to adjust. – bortzmeyer Nov 2 '12 at 21:59

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.