想让Ubuntu像Windows 8.1那样优先使用IPv6 DNS和优先查询AAAA记录. 但是发现Ubuntu还是会优先使用IPv4 DNS来查询.
结果是被GFW抢答.
$ dig @74.82.42.42 youtube.com AAAA
;; QUESTION SECTION:
;youtube.com. IN AAAA
;; ANSWER SECTION:
youtube.com. 3556 IN A 37.61.54.158
;; Query time: 73 msec
;; SERVER: 74.82.42.42#53(74.82.42.42)
正确的解析结果应该是:
$ dig @74.82.42.42 youtube.com AAAA
;; QUESTION SECTION:
;youtube.com. IN AAAA
;; ANSWER SECTION:
youtube.com. 10 IN AAAA 2607:f8b0:4001:c05::88
;; Query time: 33 msec
;; SERVER: 74.82.42.42#53(74.82.42.42)
在网上查了半天都没有找到什么好方法. IPv6用的是HE的6to4, 想让Ubuntu先用IPv6来解析, 我现在的设置是
/etc/gai.conf
label ::1/128 0
label ::/0 1
#
label 2002::/16 2
label ::ffff:0:0/96 2
label fec0::/10 3
label fc00::/7 4
label 2001:0::/32 5
label ::/96 6
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 10
/etc/resolv.conf
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 209.244.0.3
1
zro 2015-01-06 00:32:37 +08:00 1
6to4的优先级比较低,试下用6in4吧
|
2
aaaa007cn 2015-01-06 01:34:58 +08:00 1
走 ipv4 查询 AAAA 记录当然会被抢答
甚至你查询 NS 记录、MX 记录都一样会被抢答 别指望 $ dig @74.82.42.42 youtube.com AAAA 会返回正确结果 看 /etc/resolv.conf 应该是先查询那两个 ipv6 的 dns 啊 |
4
efi 2015-01-06 02:15:42 +08:00
gai.conf
|
5
latyas 2015-01-06 02:39:39 +08:00
/etc/resolv.conf顺序解析
|