I have a server running on e.g. servera.example.com and one on serverb.example.com. I want to redirect all port 80 traffic to servera.example.com to serverb.example.com, and leave all other ports as-is. The difficulty is that serverb.example.com has a dynamic IP, so the IP cannot be put directly into the iptables rule. Is there any way to do this?

You can't do this with iptables/netfilter directly as the DNS is only consulted when the rules are loaded. If serverb.example.com points to 192.0.2.1 when the rules are loaded and it changes to 192.0.2.2 then netfilter won't know and packets will be sent to he wrong address.