add get a ip address function for various environments