Skip to content

Instantly share code, notes, and snippets.

@NickCraver
Created April 27, 2017 12:19
Show Gist options
  • Save NickCraver/0a8fbf4917ffa558340f5151acadf746 to your computer and use it in GitHub Desktop.
Save NickCraver/0a8fbf4917ffa558340f5151acadf746 to your computer and use it in GitHub Desktop.
Windows 10 VPN/DNS problem repro
# Must be run as admin for registry changes
# This illustrates the problem with the Stack Exchange VPN, results locally:
# Total time for default behavior (seconds): 12.0566448
# Total time with registry tweaks (seconds): 1.0808937
# Broken/Slow (default Windows 10 behavior)
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows NT\DNSClient" -Name DisableSmartNameResolution -Value 0 -Type DWord
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name DisableParallelAandAAAA -Value 0 -Type DWord
ipconfig /flushdns | Out-null
Write-Host "Total time for default behavior (seconds): " -NoNewLine
(Measure-Command { ping -n 1 ny-sql01.ds.stackexchange.com }).TotalSeconds
# Fixed/Fast
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows NT\DNSClient" -Name DisableSmartNameResolution -Value 1 -Type DWord
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name DisableParallelAandAAAA -Value 1 -Type DWord
ipconfig /flushdns | Out-null
Write-Host "Total time with registry tweaks (seconds): " -NoNewLine
(Measure-Command { ping -n 1 ny-sql01.ds.stackexchange.com }).TotalSeconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment