Clear sendmail MX server cache or DNS cache issue

domain-name-systemsendmail

I have recently switched our mail server to a new location by updating the appropriate DNS MX records in the domain. Everythings seems to work and I am getting the email on the new server already.

However, some applications on a web server that is using sendmail to send messages, are still sending messages to the old server. I assume there is either a cache meachanism in sendmail that "remembers" the old MX server or some sort of DNS cache in place (no dnsmasq or nscd installed).

How do I make the web server's sendmail use the new MX server?

Ubuntu 12.10

Best Answer

This requires more information. Sendmail doesn't cache DNS information, the DNS-client caches information, but not always. For example, Ubuntu doesn't cache DNS records by default (since 2011).

If your MX records are updated on your Name Server, then you need to flush the cache on your web server in order for it to query your Name Server for the new MX record; otherwise, the TTL value of your previous MX record will fix the issue on its own in 24-72 hours.

  1. Validate the MX record on the name server
  2. Clear cache from web server that has issue (dependent on your OS)

Confirm lookups on webserver by using dig (linux) or nslookup (winodws):