Function nat64PrefixesFrom

  • The NAT64 prefixes that addresses reveal, when they are the IPv6 addresses a resolver gave for ipv4only.arpa (RFC 7050). That name has two addresses, both IPv4: 192.0.0.170 and 192.0.0.171. An IPv6 answer was therefore made by a DNS64 resolver, from the network's NAT64 prefix, and the place of one of those two addresses in it gives the prefix and its length. Byte 8 must be zero where the format reserves it (every length but 96), so bytes that only happen to spell one of the two addresses around a non-zero byte 8 name no prefix. Text that is not an IPv6 address is passed over.

    Parameters

    • addresses: readonly string[]

    Returns Nat64Prefix[]

    Example

    nat64PrefixesFrom(['64:ff9b::c000:aa']); // [{ bytes: [0, 0x64, 0xff, 0x9b, 0, 0, 0, 0, 0, 0, 0, 0], length: 96 }]
    nat64PrefixesFrom([]); // []: the network has no DNS64