-1

I want to know whether the following is expected behaviour.

A zone with a default TTL of 14400 has two MX records as follows:

domain.topleveldomain MX 10 host.otherdomain.topleveldomain (no TTL specified)

domain.topleveldomain 86400 MX 50 host.domain.topleveldomain

When running a dig for mx records against the authoritative nameservers for domain.topleveldoman the following is returned

domain.topleveldomain. 14400 IN MX 50 host.domain.topleveldomain.

domain.topleveldomain. 14400 IN MX 10 host.otherdomain.topleveldomain.

As you can see the TTL for MX record domain.topleveldomain is being returned as 14400 when it has a TTL of 86400.

Can someone else with DNS knowledge better than myself explain this please?

Kind regards

  • This question is off topic for Stackoverflow, and will very likely be closed - however I'm quite curious about it and will likely create a couple of MX records to have a look! If you ask again on Server fault I'll come and answer there if I find anything. – Michael B Mar 14 '16 at 11:25

2 Answers2

1

Setting a different TTL for different records of the same label, class, and type is deprecated in RFC 2181. From section 5.2:

Resource Records [(RR) with a label, class, type, and data] also have a time to live (TTL). It is possible for the RRs in an RRSet [= same label, class, and type; different data] to have different TTLs. No uses for this have been found that cannot be better accomplished in other ways. This can, however, cause partial replies (not marked "truncated") from a caching server, where the TTLs for some but not all the RRs in the RRSet have expired.

Consequently the use of differing TTLs in an RRSet is hereby deprecated, the TTLs of all RRs in an RRSet must be the same.

Community
  • 1
  • 1
timothymctim
  • 205
  • 1
  • 9
0

It's probably a simple optimization. The TTL is the maximum time the record may be cached, so setting the TTL for a whole RRset (that is, all the RRs in a zone with the same name, class and type) to the lowest TTL of the individual records is perfectly OK and may make things a bit less complex internally. So the behavior you see is slightly surprising but in no way wrong.

It might be interesting to try setting the TTL of one individual RR to something lower than the default and see what happens. If all the RRs then still get sent out with the lower TTL, the server software knows what it's doing. If all the RRs get sent out with the default TTL, then the software is buggy :-)

Calle Dybedahl
  • 5,228
  • 2
  • 18
  • 22