How to troubleshoot name resolution

Step one

Step two

The Test-NetConnection cmdlet

# Testing simple Ping test 
Test-NetConnection 172.20.1.99
# Testing TCP port with defined Port number 
Test-NetConnection google.com -Port 443
Test-NetConnection 172.18.20.6 -CommonTCPPort RDP
Test-NetConnection google.com -TraceRoute

Step three

Step four

# The file cannot be edited without administrator privileges 
notepad C:\Windows\System32\Drivers\Etc\Hosts

Step five

A common thing to do when troubleshooting name resolution, is forget that you’ve edited the hosts-file for testing and you can’t seem to understand why it won’t update or answers with wrong response.

NOTE: The Get-DnsClientCache | Format-List cmdlet is used to make the list more readable by formatting the result as a list instead of table format.

Step six

## Resolves information using default option 
Resolve-DnsName www.google.com
## Queries for information about the name server for www.google.com Resolve-DnsName -Name www.google.com -Type NS | Format-List ## Queries for canonical names
Resolve-DnsName -Name www.google.com -Type CNAME | Format-List
## Queries for type A (IPv4 server addresses) records
Resolve-DnsName -Name www.google.com -Type A | Format-List
## Queries for mail routing records
Resolve-DnsName -Name www.google.com -Type MX | Format-List
## Queries for ANY and ALL records, these are wildcard match. Resolve-DnsName -Name www.google.com -Type ANY | Format-List Resolve-DnsName -Name www.google.com -Type All | Format-List ## Resolves information against the DNS server on Cloudflare Resolve-DnsName -Name www.google.com -Server 1.1.1.1 | Format-List

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store