I would suggest
DNS Made Easy it's free and they handle it all. no need for a script or anything. set a 3 min TTL... If server "A" is down it updates ip to server "B". as soon as "A" is back online it changes over to "A" again. It checks the server status every 30-60 seconds i believe. It also allows you input a a file to run on your server and a string to grab.
I'm attaching a screenie of there demo fail over page...