Many moons ago I used heartbeat for this, but you’d need both servers in the same cidr range. I assume that’s not the case here.
In your case you could probably use a dynamic DNS service to move the IP around, but the challenge would be knowing when to kick it off.
You could write scripts to determine when the live one goes down, but we’re probably already more complicated than you were looking for.
Do you have to block communities? I thought you could just not join them to avoid their content.