solution to restoreIpAddresses