{"record":{"id":"56d3f6c8a85b6e48","repo":"TechnitiumSoftware/DnsServer","slug":"an-ipv6-network-address-is-expected-for-excludedi","errorCode":null,"errorMessage":"An IPv6 network address is expected for 'excludedIpv6' array.","messagePattern":"An IPv6 network address is expected for 'excludedIpv6' array\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Apps/Dns64App/App.cs","lineNumber":324,"sourceCode":"                            case 48:\n                            case 56:\n                            case 64:\n                            case 96:\n                                break;\n\n                            default:\n                                throw new NotSupportedException(\"DNS64 prefix can have only the following prefixes: 32, 40, 48, 56, 64, or 96.\");\n                        }\n                    }\n\n                    return new Tuple<NetworkAddress, NetworkAddress>(network, dns64Prefix);\n                });\n\n                _excludedIpv6 = jsonGroup.ReadArray(\"excludedIpv6\", delegate (string strNetworkAddress)\n                {\n                    NetworkAddress networkAddress = NetworkAddress.Parse(strNetworkAddress);\n                    if (networkAddress.Address.AddressFamily != AddressFamily.InterNetworkV6)\n                        throw new InvalidOperationException(\"An IPv6 network address is expected for 'excludedIpv6' array.\");\n\n                    return networkAddress;\n                });\n            }\n\n            #endregion\n\n            #region properties\n\n            public string Name\n            { get { return _name; } }\n\n            public bool EnableDns64\n            { get { return _enableDns64; } }\n\n            public Dictionary<NetworkAddress, NetworkAddress> Dns64PrefixMap\n            { get { return _dns64PrefixMap; } }\n","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/Apps/Dns64App/App.cs#L306-L342","documentation":"Thrown by the Dns64App Group constructor while parsing the 'excludedIpv6' array. Each entry is parsed with NetworkAddress.Parse and then must be an IPv6 address (AddressFamily.InterNetworkV6); an IPv4 address or other value raises InvalidOperationException.","triggerScenarios":"Adding an IPv4 address (e.g. '192.168.1.5' or '10.0.0.0/8') to the 'excludedIpv6' array, which is reserved for IPv6 networks to exclude from DNS64 synthesis.","commonSituations":"Reusing the networkGroupMap IPv4 subnets in excludedIpv6 by mistake; pasting a mix of v4/v6 addresses; misunderstanding the array as a general exclusion list.","solutions":["Ensure every entry in the 'excludedIpv6' array is an IPv6 network address (e.g. '2001:db8::/32', '::1/128').","Move any IPv4 exclusions out of 'excludedIpv6'; IPv4 clients are not subject to DNS64 anyway.","Validate each entry's AddressFamily is InterNetworkV6 before saving."],"exampleFix":"// before (dnsApp.config)\n\"excludedIpv6\": [ \"192.168.0.0/16\", \"2001:db8::/32\" ]\n// after\n\"excludedIpv6\": [ \"2001:db8::/32\", \"::1/128\" ]","handlingStrategy":"type-guard","validationCode":"foreach (string entry in excludedIpv6Array)\n{\n    NetworkAddress na = NetworkAddress.Parse(entry);\n    if (na.Address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)\n        throw new FormatException($\"'excludedIpv6' entry '{entry}' is not IPv6. Only IPv6 networks belong here.\");\n}","typeGuard":"static bool IsIpv6Network(string entry)\n{\n    NetworkAddress na = NetworkAddress.Parse(entry);\n    return na.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6;\n}","tryCatchPattern":null,"preventionTips":["Only put IPv6 addresses/networks in the 'excludedIpv6' array.","IPv4 is irrelevant to DNS64; exclude it elsewhere.","Validate AddressFamily of each entry before saving."],"tags":["csharp","config","ipv6","dns64","network","technitium"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}