Why would you use an IP address? You should use a hostname, which is mapped to both IP addresses. Your client operating system then has the responsibility of giving you the correct IP address for the hostname.
[Message sent by forum member 'matterbury' (matterbury_at_abinitio.com)]
http://forums.java.net/jive/thread.jspa?messageID=362947