Since people have expressed interest in more of the following:
- No nonsense short videos
- Explanations on how to do things
- More baselining examples
- More script examples
I decided to combine them all into one video that is still under 5 minutes.
In this example, I baselined how close to wire speed my Powershell DNS response script is.
I also show you where in Wireshark it reports DNS response time and cover how accurate it is.
Enjoy
For those of you who want the powershell script, here you go. Please don’t ask for powershell support, you are on your own. 😉
Dns.ps1
#####################Variables#####################
$numberoftests = 100
$dnsserver = "1.1.1.1"
$totalmeasurement = 0
$i = 0
$resptime = .100
$testsite = "facebook.com"
#####################Main#####################
"Tonys DNS test Powershell Script"
"the average of 100 DNS requests for $testsite will be calculated"
"Response time values will be in CSV format in dnsresults.txt"
"$(Get-Date) - Performing: $numberoftests tests to $dnsserver > $resptime seconds"
while ($i -ne $numberoftests)
{
$measurement = (Measure-Command {Resolve-DnsName $testsite -Server $dnsserver –Type A}).TotalSeconds
$totalmeasurement += $measurement
$i += 1
}
$totalmeasurement = $totalmeasurement / $numberoftests
Add-Content "dnsresults.txt" "$(Get-Date),$totalmeasurement"
If ($totalmeasurement -gt $resptime) {"** BAD RESPONSE TIME " + $totalmeasurement + " seconds"}
ELSE {"GOOD " + $totalmeasurement + " seconds"}
" "
And the DOS batch file dns.bat
echo off
cls
echo DNS response time powershell script with 10 second interval
echo set in bat file in the timeout option
echo .
echo ..
:loop
Powershell.exe -executionpolicy remotesigned -File dns.ps1
timeout /T 10
goto loop
We are always looking for people to contribute.
Its simple, click the link below
and submit an idea or outline. As long as it is technical and NOT a marketing piece, we will be more than happy to help edit and publish on our site.
Kommentare