John
John

Reputation: 41

Resolve-DnsName whoami.ultradns.net fails but nslookup whoami.ultradns.net suceeds? (powershell)

I was cleaning out some old code and decided to update a few things for powershell use when I came across this issue... In powershell (or a command prompt window) in Windows 10 I can do this with nslookup and get this:

nslookup whoami.ultradns.net
Server:  dns.sse.cisco.com
Address:  208.67.222.222

Non-authoritative answer:
Name:    whoami.ultradns.net
Address:  255.255.255.255

But, in powershell if I use Resolve-DnsName I get this (with -Type A --- the default type for nslookup is type A):

Resolve-DnsName whoami.ultradns.net -Type A

Name                                           Type   TTL   Section    IPAddress
----                                           ----   ---   -------    ---------
whoami.ultradns.net                            A      0     Answer     255.255.255.255

Notice how with Resolve-DnsName the 'IPAddress' is '255.255.255.255' which is the 'Non-authoritative answer' that was given with nslookup. But what I need to get from Resolve-DnsName is the 'Address:' (that '208.67.222.222' address in the nslookup example) but its no where to be found from Resolve-DnsName (even if I drill into the .psobject.Members... etc...).

So, how do I get the 'Address:' with Resolve-DnsName? Is it me or what?

Upvotes: 0

Views: 81

Answers (0)

Related Questions