C# Host 转 IP 地址 (域名 转 IP)
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
// var isIp = IPAddress.TryParse("220.181.38.150", out var _);
var addresses = Dns.GetHostAddresses("www.baidu.com");
var ip = addresses[0].ToString();
}
}