Does SendMail Cache DNS Records? – How to Flush and Logic Explained

centosdomain-name-systememaillinuxsendmail

CentOS 5.x | SendMail

I have a SendMail server configured to smarthost to a FQDN (for the purpose of discussion, let's call it group.example.com). group.example.com originally had two A records associated with it: 1.1.1.1 and 2.2.2.2. Under this scenario, it would usually send email evenly to both servers.

I've recently added a third A record to the same FQDN: 3.3.3.3. What's strange is that I'm not seeing any traffic ever going to 3.3.3.3

My questions are:

1) Does SendMail cache DNS records? If so, how can this be flushed?

2) How does sendmail (or the native dns resolver if it's just CentOS) evaluate which of the 3 A records to use?

Best Answer

I don't have an authoritative answer, but generally if something is caching DNS records it will probably respect the TTL associated with the record. The native resolver will generally return DNS records in the order returned from your nameserver, and most nameservers will rotate multiple entries for a single resource. For example:

$ host group.example.com
group.example.com has address 192.168.1.1
group.example.com has address 192.168.1.2
group.example.com has address 192.168.1.3

$ host group.example.com
group.example.com has address 192.168.1.3
group.example.com has address 192.168.1.1
group.example.com has address 192.168.1.2

Applications will generally use the first result (although this isn't a given; some applications may choose a random result from the list).