powershell how to resolve name to IP address using Windows method
I see people using this: [Net.DNS]::GetHostEntry("serverName").addressList[0].IPAddressToString ...and that will work for me. Except, what if I have an entry in the hosts file? Does this use the same method that Windows uses or skip the DNS cache and hosts file and always query a DNS server? I would like to use whatever method Windows uses for browers, Windows Explorer, ping, etc. Why not just use the built-in DNS cmdlets? Or is there a particular reason you are traveling down the raw .Net path? Code project, homework assignment, curiosity? Get-Command -Name Resolve-Dns* | Format-Table