simplifying code to find server's ip address