# DNS leak test - SYSTEM resolver path (via bash.ws) # Run: right-click -> Run with PowerShell, or: powershell -ep bypass -f this-file $ErrorActionPreference = 'SilentlyContinue' Write-Host 'Getting test id...' $id = (Invoke-WebRequest -UseBasicParsing 'https://bash.ws/id').Content.Trim() try { Invoke-WebRequest -UseBasicParsing ('https://ipv4.bash.ws/myip/test/' + $id) | Out-Null } catch {} try { Invoke-WebRequest -UseBasicParsing ('https://ipv6.bash.ws/myip/test/' + $id) | Out-Null } catch {} Write-Host 'Sending 10 DNS probes via your SYSTEM resolver...' 1..10 | ForEach-Object { Resolve-DnsName ($_.ToString() + '.' + $id + '.bash.ws') | Out-Null } Start-Sleep -Seconds 2 $url = 'https://bash.ws/dnsleak/test/' + $id + '?json=2' $data = Invoke-RestMethod $url Write-Host '' Write-Host '== Your IP ==' -ForegroundColor Cyan $data | Where-Object { $_.type -eq 'ip' } | ForEach-Object { Write-Host ($_.ip + ' [' + $_.country_name + ' ' + $_.city_name + ', ' + $_.asn + ']') } Write-Host '' Write-Host '== DNS servers that resolved for you ==' -ForegroundColor Cyan $dns = $data | Where-Object { $_.type -eq 'dns' } if (-not $dns) { Write-Host 'No DNS servers found - try again.' -ForegroundColor Yellow } $dns | ForEach-Object { Write-Host ($_.ip + ' [' + $_.country_name + ' ' + $_.city_name + ', ' + $_.asn + ']') } Write-Host '' Write-Host '== Conclusion (bash.ws) ==' -ForegroundColor Cyan $data | Where-Object { $_.type -eq 'conclusion' } | ForEach-Object { Write-Host $_.ip } Write-Host '' Write-Host 'If any DNS server above belongs to your ISP while you are on a VPN/proxy, your DNS is leaking.' Read-Host 'Press Enter to exit'