C # resolving DNS aliases for a host

I am trying to query the DNS server for DNS aliases (CNAME records) and gethostentry always does not return any aliases. I believe this is due to MSDN (the "Aliases" property of the returned IPHostEntry instance is not populated with this method and will always be empty. ")

So the question is, how do I get aliases for my code?

IPAddress hostIPAddress = IPAddress.Parse("192.168.1.2"); IPHostEntry myHost = Dns.GetHostEntry(hostIPAddress); String[] myAliases = myHost.Aliases; 
+2
source share

Source: https://habr.com/ru/post/1341873/


All Articles