var url = "https://www.google.com/"; Uri myUri = new Uri(url); var ip = Dns.GetHostAddresses(myUri.Host)[0];