How to Configure a Static IPv4 Address and DNS on Windows Server
Applies to: Windows Server 2019, 2022 and 2025
Infrastructure servers commonly need predictable addressing. A wrong interface, gateway or DNS value can immediately terminate remote access, so perform this change from console access or with a tested recovery path.
This procedure is written for administrators working on a console or through an access path that will remain available during network and restart operations. If Netcloud24 manages the server, review the change with support when it affects licensing, connectivity or recovery. See networkmanager.info for managed Windows VPS and RDS CAL services in Canada.
Before you begin
- Obtain an unused IP address, prefix length, gateway and DNS server list.
- Identify the correct adapter by name, index and MAC address.
- Confirm the address is reserved or excluded from DHCP.
- Record the current configuration for rollback.
Procedure
Step 1: Inventory adapters
List interface aliases and current addressing.
Get-NetAdapter
Get-NetIPConfigurationStep 2: Save current values
Record existing IPv4, gateway and DNS information in the change ticket.
Step 3: Assign the address
Replace the documentation example with approved production values.
New-NetIPAddress -InterfaceAlias 'Ethernet' -IPAddress '192.0.2.10' -PrefixLength 24 -DefaultGateway '192.0.2.1'Step 4: Configure DNS resolvers
Domain members should normally use approved Active Directory DNS servers, not arbitrary public resolvers.
Set-DnsClientServerAddress -InterfaceAlias 'Ethernet' -ServerAddresses ('192.0.2.20','192.0.2.21')Step 5: Test connectivity
Validate local addressing, gateway reachability, DNS resolution and the management path.
Verify the result
Use targeted tests instead of assuming the absence of an error means success.
Get-NetIPConfiguration
Test-NetConnection 192.0.2.1
Resolve-DnsName networkmanager.info
Test-NetConnection networkmanager.info -Port 443Rollback or recovery
From console access, remove the new address with Remove-NetIPAddress, remove the default route if needed and restore the previously recorded DHCP or static configuration.
Version notes
The cmdlets are available across Windows Server 2019, 2022 and 2025. Replace all TEST-NET example addresses before use.
Operational checklist
- Record the change, administrator and maintenance window.
- Confirm monitoring and backups after any restart.
- Test the service from a representative client, not only from the server console.
- Remove temporary firewall rules, accounts or installation media.
Need a managed Windows Server?
Netcloud24 provides managed Windows VPS plans with Windows Server Standard, RDS User CAL options, daily backups and Canadian support. Review current configurations at https://networkmanager.info/.