Update check-dns.ps1

This commit is contained in:
Markus Fleschutz 2023-02-19 10:38:35 +01:00
parent a40f0cf9c7
commit e5bdad8197

View File

@ -2,7 +2,7 @@
.SYNOPSIS
Checks the DNS resolution
.DESCRIPTION
This PowerShell script measures and prints the DNS resolution speed by using 200 popular domains.
This PowerShell script measures the DNS resolution speed by using 200 popular domains.
.EXAMPLE
PS> ./check-dns
DNS resolution is 440.5 domains per second
@ -17,7 +17,7 @@ try {
$Table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
$NumRows = $Table.Length
Write-Progress "⏳ Resolving $NumRows domains..."
Write-Progress "⏳ Resolving $NumRows popular domains..."
$StopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) {
foreach($Row in $Table){$nop=dig $Row.Domain +short}
@ -32,7 +32,7 @@ try {
} else {
Write-Host "⚠️ DNS resolution is $Average domains per second only!"
}
Write-Progress -completed "DNS checked."
Write-Progress -completed " "
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"