4 ms·
Off-topic, but a fun way to take this to the next level: if you have your own domain, you can set mx records with the same priority at different services to ran
by computer 13y ago
Off-topic, but a fun way to take this to the next level: if you have your own domain, you can set mx records with the same priority at different services to randomly scatter your incoming mail. You can then pull them in with pop3 with your mail client or getmail with something like Dovecot to provide a self-hosted IMAP interface.
You get the added benefit of having automatic fallbacks if one of your mail services is down.
- sudonim 13y agoWould you really get a random distribution if MX records all had the same priority? Sounds like a fun test & experiment.
- computer 13y agoAs far as I know that's the expected behaviour. I also saw it in practice, although I did not study the exact distribution in much detail. The reason for this behaviour would be that you would normally use this for load balancing. You can normally get the same behaviour by setting one MX record to a local A record (mail.example.com), and then serving several IPs for that A record in a round-robin/random fashion.
- jlgaddis 13y agoYou should (in theory, at least). I can't speak for all DNS servers but BIND will return them in a different order each time it answers an query. For example, the first query returns "mx1, mx2, mx3"; next query returns "mx2, mx3, ms1"; next query returns "mx3, mx1, mx2". Many resolvers seem to simply use the first one so it's roughly equivalent to round robin load balancing.