How to Disable IPv6 on Windows Server using PowerShell

The Trouble with IPv6 on Windows Server

While IPv6 is the future of internet routing, many legacy corporate networks, older VPN tunnels, and specific enterprise applications still rely entirely on IPv4. By default, Windows Server operates in a “dual-stack” mode, preferring IPv6 over IPv4 whenever a DNS query returns both types of records. If your network does not have a properly configured IPv6 routing infrastructure, this preference can cause severe latency, dropped connections, and bizarre application timeouts as the server attempts to route traffic over a broken IPv6 path before finally falling back to IPv4.

While you can disable IPv6 by opening the Network Adapter properties GUI and unchecking a box, this only disables it for that specific adapter. To disable IPv6 entirely across all adapters (including virtual and loopback interfaces) at the registry level, you must use PowerShell.

Disabling IPv6 via the Registry

Microsoft explicitly recommends using the DisabledComponents registry key to manipulate the IPv6 stack, rather than unchecking the box in the GUI.

Open an elevated PowerShell prompt (Run as Administrator) and execute the following command to create the necessary registry key and set its value to 0xff (which completely disables IPv6 on all interfaces):

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -Name "DisabledComponents" -Value 0xff -PropertyType DWord -Force

Note: If the DisabledComponents key already exists, the -Force parameter will simply overwrite its value.

Applying the Change

Because you are modifying the core TCP/IP networking stack in the Windows kernel, the change will not take effect immediately. You must restart the server.

Restart-Computer -Force

Alternative: Preferring IPv4 Over IPv6

In some modern environments (like those heavily utilizing Microsoft Exchange or DirectAccess), completely disabling IPv6 can actually break core Windows features. If you are experiencing DNS resolution issues but cannot afford to completely disable the protocol, the best practice is to configure the server to prefer IPv4 over IPv6.

You can achieve this by setting the DisabledComponents value to 0x20 instead of 0xff.

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -Name "DisabledComponents" -Value 0x20

Reboot the server, and Windows will now always attempt an IPv4 connection first, only falling back to IPv6 if absolutely necessary, drastically improving network reliability on older domains.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.