Skip to content

Instantly share code, notes, and snippets.

@amutu
Last active March 23, 2026 09:09
Show Gist options
  • Select an option

  • Save amutu/6b44af2d36e03fe12b3d5e99bd3deea5 to your computer and use it in GitHub Desktop.

Select an option

Save amutu/6b44af2d36e03fe12b3d5e99bd3deea5 to your computer and use it in GitHub Desktop.
public nat64 for HongKong

香港nat64的背景

对于ipv6 only的网络,要访问ipv4资源,可以使用nat64实现。公开的免费nat64大部分都在欧美地区,比如这里https://nat64.net/public-providers 列出的。 香港地区没有公共nat64,如果ipv6 only网络想要访问ipv4 only的资源(如github)则比较麻烦,因此我自己建了一个,共享出来给有需要的人。

香港的公共nat64和dns64

这是我自建的一个nat64服务,位于香港:

dns64-hk.rasde.com 2600:70ff:ac2c::64

nat64前缀:2600:70ff:ac2c:64::/96

使用方法

备份当前dns解析配置文件:

mv /etc/resolv.conf /etc/resolv.conf_bk

配置使用dns64做解析

echo "nameserver 2600:70ff:ac2c::64" > /etc/resolv.conf
echo "options edns0" >> /etc/resolv.conf

测试和问题定位

整体功能:

ping6 github.com

如果ping通,表示dns64和nat64 OK

仅测试dns64:

dig github.com @2600:70ff:ac2c::64 AAAA

如果返回2600:70ff:ac2c:64::xxxx:yyyy则表示dns64 OK

尽测试nat64:

ping6 2600:70ff:ac2c:64::1.1.1.1

如果可以ping通,则表示nat64 OK

说明

  1. 免费服务,不保证稳定,要求高的请慎用
  2. 仅限香港地区使用,已屏蔽大陆IPv6地址
  3. 资源有限,请勿滥用

参考文档

技术栈

有问题可以在本文档下留言。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment