IPv6 Apache 域名DNS AAAA配置

Content Index
[Hide]

IPv6 长度:

IPv6是128bit,和MD5一样,对每个IPv6进行MD5,会出现什么情况?MD5用完了?

IPv6 DNS:

未知国家
2001:470:20::2
加拿大
2001:478:6:0:230:48ff:fe22:6a29
英国
2001:7fd::1
日本
2001:dc4::1

Linux优先使用IPv6 DNS:

sudo vi /etc/resolv.conf

Linux命令 ping IPv6:

Linux下ping IPv6需要使用ping6,如果使用ping,则会提示ping: unknown host。

ping6 ipv6.google.com
ping6 2001:470:20::2
PING 2001:470:20::2(2001:470:20::2) 56 data bytes
64 bytes from 2001:470:20::2: icmp_seq=11 ttl=60 time=714 ms
64 bytes from 2001:470:20::2: icmp_seq=12 ttl=60 time=4.65 ms
ping 2001:470:20::2
ping: unknown host 2001:470:20::2

Windows命令 ping IPv6:

ping -6 ipv6.google.com

Linux命令 wget IPv6:

wget -6 http://ipv6.google.com

Linux和Windows命令查询域名AAAA记录,是否支持IPv6:

Linux和Windows都是使用nslookup程序查询dns。

$ nslookup
> set querytype=aaaa
> ipv6.google.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
ipv6.google.com	canonical name = ipv6.l.google.com.
ipv6.l.google.com	has AAAA address 2404:6800:8005::6a

由此可知,IPv4的DNS也能返回域名的IPv6记录,即AAAA记录。

$ nslookup
> set querytype=aaaa
> google.com
Server:		2001:470:20::2
Address:	2001:470:20::2#53

Non-authoritative answer:
google.com	has AAAA address 2001:4860:800b::69

配置域名同时支持IPv6和IPv4:

领先的域名注册商同时支持IPv6和IPv4,比如godaddy、namesilo,在注册商这里购买了域名之后,登录到域名管理界面,可以设置A记录和AAAA记录。

假设购买了example.com,希望example.com同时支持IPv6和IPv4,则添加一条A记录指向192.0.32.10,添加一条AAAA记录,指向2620:0:2d0:200::10,等待一段时间即可生效(等待时间与TTL有关)。结果如下:

$ nslookup
> example.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	example.com
Address: 192.0.32.10
> set querytype=aaaa
> example.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
example.com	has AAAA address 2620:0:2d0:200::10

配置域名只支持IPv6:

假设购买了google.com,希望ipv6.google.com只支持IPv6,不支持IPv4,则不添加A记录,只添加一条AAAA记录,指向2404:6800:8005::68。结果如下:

$ nslookup
> ipv6.google.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
ipv6.google.com	canonical name = ipv6.l.google.com.
> ipv6.l.google.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
*** Can't find ipv6.l.google.com: No answer
> set querytype=aaaa
> ipv6.google.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
ipv6.google.com	canonical name = ipv6.l.google.com.
ipv6.l.google.com	has AAAA address 2404:6800:8005::68

Apache httpd配置IPv6:

Apache httpd配置支持IPv6,需要给IP带上方括号,参考:http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#virtualhost

<VirtualHost [2404:6800:8005::68]:80>
ServerAdmin webmaster@ipv6.google.com
DocumentRoot /var/www/html/ipv6.google.com/
ServerName ipv6.google.com
</VirtualHost>

IPv4内网用户如何使用IPv6:

安装Teredo隧道即可。访问IPv6网站通过Teredo服务器转发,速度受影响。

注意:

Teredo隧道与PPPOE冲突,解决方法:使用路由拨号,本机只有一个本地连接即可。

Teredo隧道与多网卡冲突,比如virtualbox的虚拟网卡,解决办法:禁用别的网卡,只留一个本地连接。

参考:

在IPv4网络下接入IPv6网络的方法:http://www.ipv6bbs.cn/thread-151-1-1.html

资料(你懂的):http://felixcat.net/2010/04/install-teredo-ipv6/

http://www.ipv6home.cn/html/63/t-17563.html

Win 7下用Teredo隧道接入IPv6后,操作系统默认还是直接走IPv4:http://social.technet.microsoft.com/Forums/zh-CN/window7betacn/thread/ae1f7d47-aa19-493d-a10d-f8032441a147/

teredo IPv6 配置hosts后无法使用gtalk客户端(解决办法:使用Pidgin):http://www.google.com/support/forum/p/other/thread?tid=4f65f26a7da1785f&hl=zh-CN

IPv4外网用户如何使用IPv6:

安装isatap隧道即可。访问IPv6网站通过isatap网关转发,速度受影响。

如何设置浏览器默认使用IPv6:

1、真实IPv4 + 真实IPv6

操作系统会优先使用IPv6(未测试)。

2、真实IPv4内网+ IPv6 Teredo隧道

当域名同时有A和AAAA记录时,Windows 7、Ubuntu优先使用真实IPv4内网,所以需要修改hosts加入IPv6。

当域名只有AAAA记录时,Ubuntu可直接访问(比如ipv6.google.com),不用配hosts。

2、真实IPv4外网+ IPv6 isatap隧道

XP可以直接访问ipv6.google.com,不能直接访问docs.google.com,需要配hosts。

IPv6路由器:

D-Link一百元的家用路由器国外版本支持IPv6:http://www.dlink.com/ipv6,比如DIR-615,截图在最后。但国内版本不知是否支持IPv6,京东客服说不支持。

TP-Link家用路由器不支持IPv6。

是不是刷了dd-wrt完整版操作系统的路由器都支持IPv6,还待确认。

参考资料:

测试浏览器是否支持IPv6:http://test-ipv6.com/

测试浏览器是否默认使用IPv6:http://www.kame.net/

火狐扩展,显示正在访问的网站IP,可以看出是否是IPv6:https://addons.mozilla.org/zh-CN/firefox/addon/worldip-flag-and-datacenter-pi/

Windows 7 in NAT Lan teredo:

Ubuntu 11.04 in NAT Lan teredo:

D-Link DIR-615 ipv6:

本文链接:IPv6 Apache 域名DNS AAAA配置

转载声明:本站文章若无特别说明,皆为原创,转载请注明来源:Rexdf,谢谢!^^


カテゴリー: 网站建设 タグ: , パーマリンク

One Response to IPv6 Apache 域名DNS AAAA配置

  1. rexdf のコメント:
    Unknown Unknown

    测试下 头像

コメントを残す

メールアドレスが公開されることはありません。

*

:zsmilebig: :zsadbig: :zwiredbig: :zgreenhappy: more »

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください