4.6. Adding Mail Servers to dnsmasq

You have some local mail servers that you want your LAN hosts to know about. How do you do this with dnsmasq?

dnsmasq has a special record type for mailservers. You need these three lines:

	mx-host=alrac.net,mail.alrac.net,5
	mx-target=mail.alrac.net
	localmx

The mx-host line needs the domain name, server name, and MX priority. The mx-target line is the server name. localmx means all local machines should use this server.

A priority number of 5 means the server is higher priority than servers with larger numbers, typically 10 and then multiples of 10. If you have only one mail server, you should still give it a priority to keep clients happy.