An open API service indexing awesome lists of open source software.

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.

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.