I think it is not easy and in my opinion if even possible should not be used.
The problems I can see are following:
1. DNS records are stored (at least should be stored) on 2 DNS servers: primary and secondary.
So for your purposes you should make changes on both ones each time you want to do "switch"
2. The resolving is done in first step from local host cache and next by using the cashing resolvers rather than by reading records from primary or secondary authoritative servers directly.
So after "switch" - until data in cache(s) are valid (typical expiration is 2-3 days) - a number of host will try to get the website from "old" server.
Of course, you can try to create DNS record with very short validity time but:
- some cashing servers ignore very short record expiration time
- assuming everything will go ok - you force incredible high traffic concerned with DNS resolving - therefore in my opinion this method should not be used
My advice is to use additional host for "switch" between web servers.
You can do it in two ways:
a. using http redirection
b. by traffic forwarding.
The first solution is in my opinion better one since makes less problems and bandwidth load.
It can be easily implemented for instance with php and give powerful possibilities: running script can redirect the client using any kind of criteria: source IP, browser type, current load, etc.
Using one of above method no DNS changes are required.
P.S. You can also try
this solution