Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / How to Prefer IPv4 over IPv6 in Windows Networks

April 15, 2025

How to Prefer IPv4 over IPv6 in Windows Networks

By default, if a remote host has both IPv4 and IPv6 addresses, the Windows computer will try to connect to it using its IPv6 address. If the DNS server or mDNS protocol (on the local network) returns that the host has AAAA and A records, then by default, the connection is made to the IPv6 address contained in the AAAA record. This can be a problem for some network services or legacy apps that don’t support IPv6 (or don’t listen on that network interface). In this case, you can increase the priority of the IPv4 protocol over IPv6 in Windows.

Let’s look at a simple example of a workgroup-based local network (without a DNS server) that uses broadcast queries for name resolution using the built-in Multicast DNS (mDNS) protocol. Check which records and addresses the mDNS protocol returns for another computer on the same local network.

Resolve-DnsName DESKTOP-ABCD1234

Resolve-DnsName returns A and AAAA records with IPv4 and IPv6 addresses

Here, you can see that there are two records ( AAAA and A) for the remote computer, with IPv6 and IPv4 addresses, respectively. Now, check which protocol is used by default to connect to the remote computer. Perform a simple ping with a remote computer name. The ping command should return the IPv6 address of the computer instead of the IPv4.

Windows: ping returns an IPv6 instead of IPv4

Completely disabling IPv6 in Windows is not recommended because it can cause problems with certain network services and apps.

Get the current IPv6 prefix policy settings (which determine the priority of use for different types of addresses) by using the command:

netsh interface ipv6 show prefixpolicies

or

Get-NetPrefixPolicy

Windows uses this table to decide which address to use for a connection when both IPv4 and IPv6 addresses are available for a remote host (the higher the Precedence value, the higher the priority of the policy).

netsh interface ipv6 show prefixpolicies - order of preference

Let’s look at the basic precedence entries:

  • ::1/128 – IPv6 loopback interface (highest priority)
  • :/0: — global IPv6 address
  • ::ffff:0:0/96 used to map IPv4 to IPv6
  • ::/96 – prefix corresponding to IPv4 address

To change the preference order in the prefix policy so that IPv4 addresses have a higher priority, run the command:

netsh interface ipv6 set prefix ::/96 60 3
netsh interface ipv6 set prefix ::ffff:0:0/96 55 4

This configures Windows to prefer the IPv4 protocol over IPv6 without completely disabling IPv6 (no reboot is required). Try to ping the remote host in your LAN once more. Now, the host name resolution will return the IPv4 address.

Ping over IPv4 instead of IPv6

Confirm the preference of the IPv4 protocol over the IPv6 protocol in a prefix policy table.

IPv4 prefix priority in prefixpolicies

Reset the network settings for IPv6 protocol to return the prefix policy settings to their defaults:

netsh interface ipv6 reset

You can also use the registry to prioritize IPv4 over IPv6. Go to the reg key HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters, create a REG_DWORD entry with name DisabledComponents and value 0x20. Restart the computer for the changes to take effect.

You can set this registry entry manually or from cmd:

reg add HKLM\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 0x20

Registry: DisabledComponents 0x20 (Prefer IPv4 over IPv6)

To restore the original configuration where IPv6 has higher priority than IPv4, run the following command:

reg add hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 0x0

If you want all computers in the domain to prioritize IPv4 over IPv6, you can deploy this registry setting using Group Policy Preferences.

Set IPv4 priority using GPO

0 comment
4
Facebook Twitter Google + Pinterest
Windows 10Windows 11Windows Server 2022
previous post
Load Drivers from WinPE or Recovery CMD
next post
How to Pause (Delay) Update Installation on Windows 11 and 10

Related Reading

How to Assign (Passthrough) a Physical GPU to...

June 11, 2024

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

Disable BitLocker Automatic Drive Encryption in Windows 11

October 16, 2024

Enable Hyper-V on Windows 10/11 Pro and Home...

August 12, 2024

Get Started with Docker on Windows (WSL2) without...

September 4, 2024

Disable and Completely Remove Widgets from Taskbar in...

September 26, 2024

Check the Software Installation/Removal History in Windows

October 8, 2024

How to Add or Remove Pinned Folders to...

August 11, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Upgrading to Windows 11 on Unsupported Hardware
  • Create a Custom Windows Image with Pre-installed Apps
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • How to Copy/Paste to MS Word without Losing Formatting
  • Fix: Windows Update Tab (Button) is Missing from Settings
  • Configuring RemoteApps Hosted on Windows 10/11 (without Windows Server)
  • Get Started with Docker on Windows (WSL2) without Docker Desktop
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top