Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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.