DNS configuration for an email server

Emails requires specific DNS records. You have add at least two new fields.

First, make sure you have an "A" record (probably) :

athome.tld.  IN  A

Of course, use your real IP here.

You must add a MX field pointing to the previous record :

athome.tld.  IN  MX  1  athome.tld.

Notice ending dots.

"1" describe the weight of the field. This parameter will be used to prioritize mails servers because some of them will be backups if the main server is unavailable. We'll talk about this later.

Some may want to use a specific domain, another A field to organize their mail servers. That is not mandatory, but interesting :

mail1.athome.tld. IN  MX  1  mail1.athome.tld..
mail1.athome.tld. IN  A

Below is another example using a different syntax :

$ORIGIN athome.tld
@      IN  MX  10  mail1.athome.tld.
@      IN  A
mail1  IN  A

Here, you can see the mail server for this zone is hosted on a different IP.

That's all for now.