Resolve-DNSName Slow In Returning Results For Remote IP

Resolve-DNSName Slow In Returning Results For Remote IP

Problem

I need to get the host name of a server but I only have its IP address. I used Resolve-DnsName command with IP address and it took 6 seconds for the results to show up in the screen.

I also tried using the IP address of the server that I am using and it returned the values instantaneously. I am assuming it is quicker since it is getting the information locally. I am expecting that the speed to get the information would be similar for both.

I tried the command again on a 3rd server and the speed is the same with the first one.

I researched and tried additional parameter for Resolve-DnsName to help it run faster.

Solution 

1. Tried -QuickTimeout, but it still took 6 seconds to display the records.

 PowerShell

Resolve-DnsName 250.251.252.253 -QuickTimeout

2. Tried -NoRecursion, it still took 6 second for the results to return.

 PowerShell

Resolve-DnsName 250.251.252.253 -NoRecursion -QuickTimeout

3. Tried -DnsOnly, this command returned the values quickly.

PowerShell

Resolve-DnsName 250.251.252.253 -DnsOnly

Sometimes it just takes a few trial and error since the documentation did not specify that it will return the results quicker -DnsOnly parameter is used.