mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-28 15:46:35 +01:00
Update check-dns.ps1
This commit is contained in:
parent
a40f0cf9c7
commit
e5bdad8197
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks the DNS resolution
|
Checks the DNS resolution
|
||||||
.DESCRIPTION
|
.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
|
.EXAMPLE
|
||||||
PS> ./check-dns
|
PS> ./check-dns
|
||||||
✅ DNS resolution is 440.5 domains per second
|
✅ DNS resolution is 440.5 domains per second
|
||||||
@ -17,7 +17,7 @@ try {
|
|||||||
$Table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
|
$Table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
|
||||||
$NumRows = $Table.Length
|
$NumRows = $Table.Length
|
||||||
|
|
||||||
Write-Progress "⏳ Resolving $NumRows domains..."
|
Write-Progress "⏳ Resolving $NumRows popular domains..."
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
foreach($Row in $Table){$nop=dig $Row.Domain +short}
|
foreach($Row in $Table){$nop=dig $Row.Domain +short}
|
||||||
@ -32,7 +32,7 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
Write-Host "⚠️ DNS resolution is $Average domains per second only!"
|
Write-Host "⚠️ DNS resolution is $Average domains per second only!"
|
||||||
}
|
}
|
||||||
Write-Progress -completed "DNS checked."
|
Write-Progress -completed " "
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user