To the best of my knowledge, the below DNS records should work as a failover for my mail servers:
example.com A 192.0.2.1 3600
www.example.com A 192.0.2.1 3600
ftp.example.com A 192.0.2.1 3600
example.com TXT "v=spf1 a mx a:spf.batchsmtp.com ip4:198.51.100.1 ip4:203.0.113.2 -all" 86400
example.com MX srv1.batchsmtp.com 10 86400
example.com MX srv2.batchsmtp.com 10 86400
srv1.example.com A 198.51.100.1 3600
srv2.example.com A 203.0.113.2 3600
_smtp._tcp.example.com SRV 2 25 srv1.example.com 10 3600
_smtp._tcp.example.com SRV 1 25 srv2.example.com 10 3600
_imaps._tcp.example.com SRV 2 993 srv1.example.com 10 3600
_imaps._tcp.example.com SRV 1 993 srv2.example.com 10 3600
_imap._tcp.example.com SRV 2 143 srv1.example.com 10 3600
_imap._tcp.example.com SRV 1 143 srv2.example.com 10 3600
_submission._tcp.example.com SRV 2 587 srv1.example.com 10 3600
_submission._tcp.example.com SRV 1 587 srv2.example.com 10 3600
I've turned srv1.example.com
off but my email clients just time out and never seem to contact srv2.example.com
(short TTLs are for testing).
Online DNS tools never seem to show my SRV records, but I believe that is normal behavior.
- Am I doing something wrong here?
- Or does it maybe take a long time before mail clients start using these records (as in 48 hours)?
- Do I need to put something specific in my email client? (which target host)
Email clients tried: Mozilla Thunderbird, iOS Mail
This is what a dig gives:
;; QUESTION SECTION:
;_imaps._tcp.example.com. IN SRV
;; ANSWER SECTION:
_imaps._tcp.example.com. 3600 IN SRV 10 2 993 srv1.example.com.
_imaps._tcp.example.com. 3600 IN SRV 10 1 993 srv2.example.com.
;; AUTHORITY SECTION:
example.com. 86400 IN NS ns3.nsdomain.com.
example.com. 86400 IN NS ns2.nsdomain.com.
example.com. 86400 IN NS ns1.nsdomain.com.
;; ADDITIONAL SECTION:
srv2.example.com. 2502 IN A 203.0.113.2
srv1.example.com. 3600 IN A 198.51.100.1