Pez
Pez

Reputation: 1299

Bypassing DNS server to request domain from specific server

I have a special situation that is outside my area of expertise, being a PHP developer and not a network administrator.

A client wants to do split testing between the new website I built them, and their old website built by a competitor. All traffic will be sent to the existing url (a.com). I have access to the client's godaddy account for a.com, and traffic is sent via an A-Record to a server that I do not have access to. The old webmaster will not do anything to help my cause, understandably.

Thus, I believe I need to change the a-record on the domain to point to my own server. But how will I send 50% of traffic to the old server? If I navigate to the IP Address on the A-Record directly the website doesn't come up, I presume because the server only knows to use the vhost if the request comes in as a.com. So, I need to change the a-record, then send traffic to this IP address requesting this server....and I need to do this for 50% of the hits I receive. I'm not sure if I can do this using php header()...I'm not sure how to do this at all.

Any recommendations are welcome...I'm racking my brain but can't find a solution.

Upvotes: 2

Views: 594

Answers (2)

Nathan
Nathan

Reputation: 1525

If you can get DNS moved to a server you have access to. DNS Round Robbin may be a crude method to achieve this. Setting up 2 a records, one for each server will automatically alternate as the domain is resolved. I've not tried this with completly different content on the 2 servers but it may be worth testing

Upvotes: 1

Hydra IO
Hydra IO

Reputation: 1557

Are any users hitting your version of the website?

IF you have access to the a records, you can actually add two a records.

@ IP1
@ IP2

And let DNS do it's thing.

EDIT

or as the other user said, apache load handling can do the trick

Upvotes: 1

Related Questions