I'm writing a DNS test script to validate DNS functionality post-migration from one DNS platform to another. I'm hitting a couple of issues with the script:
Resolve-DnsNames fails with single-label names, e.g. "Resolve-DnsName server1 -DnsOnly" returns Dns name doesn't exist. Resolve-DnsName with the FQDN works as expected. Nslookup works fine with the single-label name. Is there a way to get Resolve-DnsName working with only single label names?
I've tried using nslookup instead, however it throws errors for non-authoritative answers and I've struggled to catch the errors (they don't seem to caugh with a try catch block).