Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a VPS with three IPs. They're all on completely unrelated IPs (one is 23.226.xxx.x, another is 107.161.xx.xx, a third is 167.88.xxx.xx).

If I go to beta.mydomain.com (for example, that won't actually be the subdomain), I want it to go to 23.226.xxx.x. Going to mydomain.com would just go to 107.161.xx.xx, and going to somethingelse.mydomain.com would go to 167.88.xxx.xx.

Is this possible?

share|improve this question
    
One-word answers are somewhat discouraged here and I don't think you would find "Yes" to be very helpful. Could you add to your question what you have tried already and what problems you ran into? –  Ladadadada Apr 4 at 0:36
    
@Ladadadada I'm not asking if I can do it, I'm asking how. Does that fix it or is it still against the rules? –  user215103 Apr 4 at 0:40

1 Answer 1

You just need to create 3 different A records in your DNS service pointing the domain or subdomains to the different ip addresses and then in apache create 3 different virtual hosts (one per domain/subdomain) bound each to its respective ip.

A reason to do this would be to use https, otherwise it's not needed in general since you can serve multiple domains and subdomains from the same ip address.

share|improve this answer

Your Answer

 
discard

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.