From e79773a42f1a3760d7d54a267d36d1611199c239 Mon Sep 17 00:00:00 2001 From: Dejan Date: Fri, 20 Feb 2026 10:49:05 +0000 Subject: [PATCH] Update ip-settings.ps1 added custom DNS (4) --- ip-settings.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ip-settings.ps1 b/ip-settings.ps1 index 55cb01b..d72ae9c 100644 --- a/ip-settings.ps1 +++ b/ip-settings.ps1 @@ -66,6 +66,7 @@ Write-Host " Profiles:" -ForegroundColor White Write-Host " [1] Camera Control -> 192.168.178.22 /24 GW: 192.168.178.1 DNS: 192.168.178.10 / 192.168.178.14" -ForegroundColor White Write-Host " [2] LAN Profile 2 -> 192.168.1.222 /24 GW: 192.168.1.1 DNS: Automatic" -ForegroundColor White Write-Host " [3] DHCP (automatic) DNS: Automatic" -ForegroundColor White +Write-Host " [4] DHCP (automatic) DNS: 192.168.178.10 / 192.168.178.14" -ForegroundColor White Write-Host "" $profileChoice = Read-Host " Enter profile number" @@ -113,6 +114,18 @@ elseif ($profileChoice -eq "3") { Write-OK " IP : Automatic" Write-OK " DNS : Automatic" } +elseif ($profileChoice -eq "4") { + $dns1 = "192.168.178.10" + $dns2 = "192.168.178.14" + + Set-NetIPInterface -InterfaceIndex $nicIdx -Dhcp Enabled + Set-DnsClientServerAddress -InterfaceIndex $nicIdx -ServerAddresses ($dns1, $dns2) | Out-Null + + Write-OK "Adapter '$nicName' switched to DHCP with custom DNS" + Write-OK " IP : Automatic" + Write-OK " DNS 1 : $dns1" + Write-OK " DNS 2 : $dns2" +} else { Write-Err "Invalid profile choice. No changes made." Read-Host "Press Enter to exit"