https://github.com/haiueom/win-dns
A user-friendly PowerShell script to quickly view and switch DNS settings on your active network adapters.
https://github.com/haiueom/win-dns
powershell powershell-script
Last synced: 5 months ago
JSON representation
A user-friendly PowerShell script to quickly view and switch DNS settings on your active network adapters.
- Host: GitHub
- URL: https://github.com/haiueom/win-dns
- Owner: haiueom
- Created: 2025-09-12T14:53:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-09-12T21:37:20.000Z (5 months ago)
- Last Synced: 2025-09-12T23:46:16.646Z (5 months ago)
- Topics: powershell, powershell-script
- Language: PowerShell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# win-dns
A user-friendly PowerShell script to quickly view and switch DNS settings on your active network adapters. Easily change to popular public DNS providers or revert to your network's automatic (DHCP) settings through a simple, interactive menu.
## Requirements
- Operating System: Windows 10 / 11
- PowerShell: PowerShell 5.1 or later
- Permissions: Administrator privileges are required.
## Usage
Just download `main.ps1` and run it as administrator, and then enter the number corresponding to your desired provider and press Enter.
When you run the script, you will see a menu similar to this:
```text
🔎 Current DNS Settings:
∙ Wi-Fi (Interface Intel(R) Wi-Fi 6 AX201 160MHz)
IPv4: 1.1.1.1, 1.0.0.1
IPv6: 2606:4700:4700::1111, 2606:4700:4700::1001
🌐 Select a new DNS provider:
1. Google (8.8.8.8, 8.8.4.4)
2. Cloudflare (1.1.1.1, 1.0.0.1)
3. OpenDNS (208.67.222.222, 208.67.220.220)
4. Quad9 (9.9.9.9, 149.112.112.112)
5. CleanBrowsing (185.228.168.9, 185.228.169.9)
6. Reset to Automatic (DHCP)
Enter your choice [1-6]:
```
## Configuration
You can easily customize the list of DNS providers by editing the `$dnsProviders` variable near the top of the script.
To add a new provider, simply add a new `[PSCustomObject]` to the array, following the existing format.
```powershell
$dnsProviders = @(
# ... existing providers ...
# Add your new provider here
[PSCustomObject]@{ Name = "My Custom DNS"; IPv4 = @("1.2.3.4", "5.6.7.8"); IPv6 = @("::1") }
)
```
- Name: The display name for the provider in the menu.
- IPv4: An array of one or two IPv4 server addresses.
- IPv6: An array of one or two IPv6 server addresses.
Leave the array empty (@()) if there are no IPv4/IPv6 addresses.