Display correct TTL in case of multiple responses like CNAME (FIX #29)

This commit is contained in:
Babak Farrokhi 2017-04-24 14:42:34 +04:30
parent 0c01d0ebb2
commit 6c1d7313fe
Signed by: farrokhi
GPG Key ID: 6B267AD85D632E9A

View File

@ -168,8 +168,8 @@ def dnsping(host, server, dnsrecord, timeout, count, use_tcp=False, use_edns=Fal
if answers is not None:
flags = answers.response.flags
if answers.rrset is not None:
ttl = answers.rrset.ttl
if len(answers.response.answer) > 0:
ttl = answers.response.answer[0].ttl
return server, r_avg, r_min, r_max, r_stddev, r_lost_percent, flags, ttl