对于负载平衡服务器的 CNAME,您希望刷新离您最近的记录,即初始查找。将其余查找视为后端处理,在这种情况下,我喜欢将其称为 Akamai shuffle。
编辑:如果你直接查询权威 NS,你应该得到“真实”的 TTL:
rickbuford@ent01:~$ dig +noall +answer @ns2.google.com www.google.com
www.google.com. 300 IN A 74.125.194.103
www.google.com. 300 IN A 74.125.194.147
www.google.com. 300 IN A 74.125.194.99
www.google.com. 300 IN A 74.125.194.105
www.google.com. 300 IN A 74.125.194.106
www.google.com. 300 IN A 74.125.194.104
TTL 倒计时是缓存 LDNS 或中间服务器的功能。因此,在您的示例中:
首先,进行主要查找:
rickbuford@ent01:~$ dig www.microsoft.com
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> www.microsoft.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54032
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;www.microsoft.com. IN A
;; ANSWER SECTION:
www.microsoft.com. 60 IN CNAME toggle.www.ms.akadns.net.
toggle.www.ms.akadns.net. 123 IN CNAME www.microsoft.com-c.edgekey.net.
www.microsoft.com-c.edgekey.net. 10967 IN CNAME www.microsoft.com-c.edgekey.net.globalredir.akadns.net.
www.microsoft.com-c.edgekey.net.globalredir.akadns.net. 576 IN CNAME e10088.dspb.akamaiedge.net.
e10088.dspb.akamaiedge.net. 17 IN A 172.233.22.36
;; Query time: 19 msec
;; SERVER: 192.168.186.1#53(192.168.186.1)
;; WHEN: Thu Jun 11 21:24:28 CDT 2015
;; MSG SIZE rcvd: 237
然后需要获取最后一个 CNAME 的 NS/SOA:
rickbuford@ent01:~$ dig e10088.dspb.akamaiedge.net NS
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> e10088.dspb.akamaiedge.net NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17178
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;e10088.dspb.akamaiedge.net. IN NS
;; AUTHORITY SECTION:
dspb.akamaiedge.net. 965 IN SOA n0dspb.akamaiedge.net. hostmaster.akamai.com. 1434075886 1000 1000 1000 1800
;; Query time: 15 msec
;; SERVER: 192.168.186.1#53(192.168.186.1)
;; WHEN: Thu Jun 11 21:25:01 CDT 2015
;; MSG SIZE rcvd: 119
然后,您应该能够查询权威服务器以获取记录:
rickbuford@ent01:~$ dig +noall +answer @n0dspb.akamaiedge.net e10088.dspb.akamaiedge.net
e10088.dspb.akamaiedge.net. 20 IN A 23.207.250.131