Resolve-DnsName returns DNS name contains an invalid character

Gloria Gu 3,896 Reputation points
2020-07-15T06:54:52.413+00:00

Gday Guys,

I have put going on a forum for 5 years now to avoid being a public nuisance. Sorry I finally had to ask stupid questions now.

My issue is around doing a simple powershell line. I am not trained and sadly its hard to get my head around.

If I do Resolve-dnsname -name "http://inranetname/subname/pages/subname%20.aspx", on an intranet site, it complains of an invalid DNS name containing invalid characters. Sadly I cant put in the website names in, as its for a business, but "intranetname" and "subname" are just English lexicon, no special characters there.

I tried doing quotations, and without, also simply Resolve-dnsname "http://inranetname/subname/pages/subname%20.aspx" but they all say the same thing.

All i want to do an nslookup but I don't have CMD prompt in our environment and I'm finally taking the plunge into PS.

Thread source link: https://social.technet.microsoft.com/Forums/windows/en-US/04689bcc-df4c-48e6-936c-f30b7366263c/resolvednsname-returns-dns-name-contains-an-invalid-character?forum=win10itpronetworking

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,302 questions
0 comments No comments
{count} votes

Accepted answer
  1. Candy Luo 12,686 Reputation points Microsoft Vendor
    2020-07-15T08:01:10.037+00:00

    Hi ,

    Welcome to our new Microsoft Q&A Platform.

    >>I tried doing quotations, and without, also simply Resolve-dnsname "http://inranetname/subname/pages/subname%20.aspx" but they all say the same thing.

    The Resolve-DnsName cmdlet performs a DNS query for the specified name.

    “http: …”, this is not a specified name. This is a URL.

    You can refer this picture:

    12474-3.png

    To resolve DNS name, you need to enter FQDN or DNS records.

    For example, FQDN: www.google.com.

    For more details, you can refer the following article:

    FQDN: https://video2.skills-academy.com/en-us/windows/win32/dns/naming-conventions

    Name resolution: https://video2.skills-academy.com/en-us/windows/win32/dns/name-resolution

    Best Regards,

    Candy

    0 comments No comments

0 additional answers

Sort by: Most helpful