Problem with DNS name resolution when using System.Net.DNS class

I recently ran into a problem when writing a PowerShell script to perform DNS Name resolution using .NET class System.Net.DNS (http://msdn.microsoft.com/en-us/library/system.net.dns.aspx). I noticed when I’m using System.Net.DNS to perform reverse lookup (GetHostByAddress method), even though the PTR record is missing in DNS, it is still able to resolve the name. It looks like this method connects to the host to retrieve its host name. When the machine is powered off, GetHostByAddress method is unable to resolve the IP address to it’s name (Which is desired result because there is no PTR record in reverse lookup zone): I then powered on

%d bloggers like this: