if you wonīt use a load-balancer or a fail-over-ip, you can also use your dns-records.
If server A canīt reach server B, A replaces the DNS-Records with the IP of server A - and vice versa. But this could result in a single point of failure.
Anyway, you must keep the data on both serves always in sync. For the databases use a replication, for the filesystem something like drbd or unision.