A predictable IPv4 address and correct DNS resolvers are prerequisites for many Windows Server roles. The address must belong to the correct network, remain unique and use the routing required by the platform. DNS must resolve the names the server actually needs, especially Active Directory service records on domain members.
This guide applies to Windows Server 2019, 2022 and 2025 using Windows PowerShell. The example is a simple single-interface server moving from DHCP to an approved static address. Replacing an established static address, configuring multiple interfaces or using provider-specific routed networking requires a tailored plan rather than blindly adding another address.
Obtain the approved network values
Ask the network owner or hosting provider for the address, prefix length, gateway and DNS resolver list. Confirm the address is assigned to this server and protected from DHCP allocation or conflicting use. A ping that receives no response is not proof that an address is available; the current owner may be offline or block ICMP.
Understand the prefix. For example, a /24 identifies a different local network boundary from a /32. Many cloud networks have platform-specific gateway and route requirements, so do not replace an unfamiliar but documented provider configuration with a conventional office-subnet assumption.
For Active Directory members, use approved resolvers that host or can resolve the internal domain. Mixing a public resolver into the list as a supposed fallback can cause intermittent domain discovery failures. Design external name resolution through the internal DNS service’s approved forwarding or recursion arrangement.
Keep console access and record the baseline
Changing the active address can end Remote Desktop, WinRM and application connections immediately. Open the platform console and verify it works before starting. A second remote session through the same adapter is not an independent recovery route.
In elevated Windows PowerShell, inventory adapters and current settings:
Get-NetAdapter | Select-Object Name, InterfaceIndex, MacAddress, Status
Get-NetIPConfiguration
Get-NetIPAddress -AddressFamily IPv4
Get-NetRoute -AddressFamily IPv4 -DestinationPrefix '0.0.0.0/0'
Get-DnsClientServerAddress -AddressFamily IPv4
Match the intended adapter using its MAC address and platform inventory. Record existing addresses, prefix lengths, DHCP state, gateway, route metrics and DNS servers. Where a team owns several interfaces, identify which one carries management traffic before modifying anything.
Keep the baseline with the change record, avoiding unnecessary confidential output. Agree a maintenance window and a rollback point. If the server hosts a domain controller, cluster, DHCP service or application bound to a specific address, include its role-specific dependency checks.
Plan the address change rather than accumulating settings
New-NetIPAddress creates an address; it is not a general “replace everything” command. On a DHCP-enabled interface, creating a static address disables DHCP for that interface. If a static address or default route already exists, adding another can leave an unintended multi-address configuration or produce a route conflict.
The example below assumes that the baseline has confirmed a suitable DHCP configuration and no conflicting static settings. For an existing static server, decide explicitly whether the old address will be retained during migration or removed. Identify exact objects before removal; do not pipe all server addresses into a removal command.
Use the actual interface alias. The sample documentation addresses in 192.0.2.0/24 are illustrative and are not your production allocation. Replace every example before applying a change.
Apply the approved static IPv4 address
Set variables only after validating the values. Preview the operation first:
$interface = 'Ethernet' # Replace with the verified adapter alias.
$address = '192.0.2.10' # Documentation example only.
$gateway = '192.0.2.1' # Replace with the platform-approved gateway.
New-NetIPAddress -InterfaceAlias $interface -IPAddress $address `
-PrefixLength 24 -DefaultGateway $gateway -WhatIf
The preview does not validate ownership, routing or provider support. Once the approved plan and console recovery are ready, remove -WhatIf to apply that specific change. Read any error rather than repeating the command until multiple settings accumulate.
Inspect the new address and its state:
Get-NetIPAddress -InterfaceAlias $interface -AddressFamily IPv4 |
Select-Object IPAddress, PrefixLength, AddressState, PrefixOrigin
Expect the intended address and prefix. An address in Duplicate or another unexpected state needs investigation before use. Do not disable duplicate-address detection to force an address into service.
Set the DNS resolver list
After confirming the correct resolver addresses, apply them to the same interface:
Set-DnsClientServerAddress -InterfaceAlias $interface `
-ServerAddresses @('192.0.2.20','192.0.2.21')
Get-DnsClientServerAddress -InterfaceAlias $interface -AddressFamily IPv4
These are documentation examples. The command sets a static DNS server list, overriding DNS values normally supplied by DHCP for that interface. The list should contain approved resolvers with the required internal and external resolution capability.
Do not confuse a DNS resolver setting with a DNS record. Pointing the server at a resolver does not create the server’s A or PTR record. Dynamic registration, DHCP updates and manually managed records are separate mechanisms whose ownership should be clear.
Verify the full communication path
Check the resulting configuration and default route first:
Get-NetIPConfiguration -InterfaceAlias $interface
Get-NetRoute -AddressFamily IPv4 -DestinationPrefix '0.0.0.0/0'
Confirm the intended gateway is associated with the correct interface. Multiple default routes can be legitimate in a designed configuration, but accidentally adding one to every adapter can create unpredictable traffic paths.
Next, test a known internal name and a service the server must reach. Replace these illustrative names with approved endpoints:
Resolve-DnsName 'dc01.corp.example.com' -Type A
Test-NetConnection 'app.corp.example.com' -Port 443
A DNS answer confirms name resolution for that query; a successful TCP test confirms a connection to that port. Neither proves application authentication. Check the actual workload and reconnect from a representative authorized management computer using the intended server name.
If a gateway blocks ping, a failed ICMP test alone does not establish that routing is broken. Conversely, successful ping does not establish that WinRM, Remote Desktop or an application port is allowed. Test each required layer deliberately.
Diagnose common failures
Immediate loss of remote access: inspect the console for a wrong adapter, prefix or gateway. Compare the provider’s network plan and any external firewall or address-binding rules.
Internet works but domain sign-in fails: inspect internal DNS resolution and domain service discovery. A public DNS answer for a website says nothing about finding the correct domain controllers.
Address exists but traffic uses another interface: inspect routes and metrics. Do not randomly delete all routes or disable adapters; storage, backup or other services may depend on them.
Only some clients fail: review server DNS records, client caches and the old address’s retirement plan. Correct the authoritative configuration before asking every user to clear caches.
Review service bindings and address inventory
After a planned address migration, check applications that bind explicitly to an IP address, inbound firewall scopes, monitoring targets and backup allow-lists. Update the network inventory and any reservation or exclusion so another administrator does not allocate the same address later. Keep IPv6 and other adapters in their designed state; disabling them is not a general remedy for an IPv4 configuration problem. Retire the previous address only after the dependent services and records have been checked.
Restore the previous configuration when necessary
Use the console and the recorded baseline. Remove only the exact newly added address and route when the approved rollback requires it, then restore the prior static settings or DHCP state. Returning to DHCP also requires checking whether the manually assigned address remains; enabling DHCP alone should not be treated as proof that every static object was removed.
If DNS previously came from DHCP, the reset operation is Set-DnsClientServerAddress -InterfaceAlias $interface -ResetServerAddresses. Use it only when that matches the baseline. Verify the resulting address, route, resolver list and application connections before closing the change.
See managing DNS records and Microsoft’s New-NetIPAddress and DNS client configuration references for supported parameter behaviour.