Skip to content

Instantly share code, notes, and snippets.

@richardhicks
Created May 14, 2025 19:12
Show Gist options
  • Save richardhicks/5f53462eb0357d4902ded1eaf1a46721 to your computer and use it in GitHub Desktop.
Save richardhicks/5f53462eb0357d4902ded1eaf1a46721 to your computer and use it in GitHub Desktop.
Configure DNS64 on Windows Server
# This Gist contains PowerShell commands to enable DNS64 on a Windows server.
# Reference: https://learn.microsoft.com/en-us/powershell/module/networktransition/set-netdnstransitionconfiguration
# Define variables
$AcceptInterface = 'LAN' # The interface name or alias that will accept DNS64 traffic
$SendInterface = 'LAN' # The interface name or alias that will send DNS64 traffic
$Nat64Prefix = '64:ff9b::/96' # The NAT64 prefix
# Configure DNS64
Set-NetDnsTransitionConfiguration -State Enabled -AcceptInterface $AcceptInterface -SendInterface $SendInterface -PrefixMapping "$Nat64Prefix,0.0.0.0/0" -PassThru
# Create firewall rules to allow DNS64 traffic inbound
New-NetFirewallRule -Name 'DNSSrv-DNS-UDP-In' -DisplayName 'DNS (UDP, Incoming)' -Description 'Inbound rule to allow remote UDP access to the DNS64 service.' -Group 'DNS64 Service' -Protocol UDP -LocalPort 53 -Direction Inbound -Profile Any -Action Allow -Enabled True
New-NetFirewallRule -Name 'DNSSrv-DNS-TCP-In' -DisplayName 'DNS (TCP, Incoming)' -Description 'Inbound rule to allow remote TCP access to the DNS64 service.' -Group 'DNS64 Service' -Protocol TCP -LocalPort 53 -Direction Inbound -Profile Any -Action Allow -Enabled True
# View DNS64 configuration
Get-NetDnsTransitionConfiguration
# Clear DNS64 configuration
Reset-NetDnsTransitionConfiguration
# Test DNS64 operation
Resolve-DnsName -Name '<name of IPv4-only resource>' -Server '<IPv6 address of DNS64 server>'
# Test example
Resolve-DnsName -Name 'ipv4.test-ipv6.com' -Server '2001:db8::9ef3:0a25:64bd:17c8'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment