Iam writing a program to gather data on ttl of various DNS records.I could get it for SOA. Can anyone say how to obtain ttl value for MX , A records ?
Edit: You'll have to query the DNS for MX or A records
Your complete response should contain:
Now, each answer will have its own header, that has the following form:
type - 16 bits
class - 16 bits
ttl - 32 bits
rdlength - 16 bits
the content after the header depends on the type of response, but the ttl is in the header.
Here's some reference: http://www.ietf.org/rfc/rfc1035.txt