c++ - Configured TTL for A record(s) backing CNAME records -


i'm using libresolv fetch list of authoritative nameservers domain , query 1 of nameservers directly resolve host.

that way, can configured ttl record , choose refresh dns records in code @ ttl.

however, i've run snafu in i'm not sure how handle hosts refer cnames. example, output www.microsoft.com looks this:

; <<>> dig 9.7.3 <<>> www.microsoft.com ;; global options: +cmd ;; got answer: ;; ->>header<<- opcode: query, status: noerror, id: 3870 ;; flags: qr rd ra; query: 1, answer: 5, authority: 8, additional: 7  ;; question section: ;www.microsoft.com.             in       ;; answer section: www.microsoft.com.      5       in      cname   toggle.www.ms.akadns.net. toggle.www.ms.akadns.net. 5     in      cname   www.microsoft.com-c.edgekey.net. www.microsoft.com-c.edgekey.net. 5 in   cname   www.microsoft.com-c.edgekey.net.globalredir.akadns.net. www.microsoft.com-c.edgekey.net.globalredir.akadns.net. 5 in cname e10088.dspb.akamaiedge.net. e10088.dspb.akamaiedge.net. 5   in            23.194.222.159 

should refreshing host using cname ttl? if so, how configured ttl cname?

or, should refreshing using using record linked cnames (i.e. e10088.dspb.akamaiedge.net)? if so, how fetch configured ttl host?

any information experts can provide appreciated.

in case of cname's load balanced servers, you'd want refresh @ closest record you, initial lookup. consider rest of lookups backend processing, in case, call akamai shuffle.

edit: if query authoritative ns directly, should "real" ttl:

rickbuford@ent01:~$ dig +noall +answer @ns2.google.com www.google.com www.google.com.         300     in            74.125.194.103 www.google.com.         300     in            74.125.194.147 www.google.com.         300     in            74.125.194.99 www.google.com.         300     in            74.125.194.105 www.google.com.         300     in            74.125.194.106 www.google.com.         300     in            74.125.194.104 

the ttl countdown function of caching ldns or intermediary server. so, in example:

first, primary lookup:

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       ;; 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            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 

then need ns/soa of last cname:

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 

you should able query authoritative server record:

rickbuford@ent01:~$ dig +noall +answer @n0dspb.akamaiedge.net e10088.dspb.akamaiedge.net e10088.dspb.akamaiedge.net. 20  in            23.207.250.131 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -