Skip to content

DNS setup

Below you can find a list of recommended DNS records. While some are mandatory for a mail server (A, MX), others are recommended to build a good reputation score (TXT/SPF) or used for auto-configuration of mail clients (SRV).


Reverse DNS of your IP

Make sure that the PTR record of your IP matches the FQDN of your mailcow host: ${MAILCOW_HOSTNAME} 1. This record is usually set at the provider you leased the IP (server) from.

The minimal DNS configuration

This example shows you a set of records for one domain managed by mailcow. Each domain that is added to mailcow needs at least this set of records to function correctly.

# Name              Type       Value
mail                IN A
autodiscover        IN CNAME   mail
autoconfig          IN CNAME   mail

@                   IN MX 10   mail


In the example DNS zone file snippet below, a simple SPF TXT record is used to only allow THIS server (the MX) to send mail for your domain. Every other server is disallowed but able to ("~all"). Please refer to SPF Project for further reading.

@                   IN TXT     "v=spf1 mx a -all"

It is highly recommended to create a DKIM TXT record in your mailcow UI and set the corresponding TXT record in your DNS records. Please refer to OpenDKIM for further reading.

dkim._domainkey     IN TXT     "v=DKIM1; k=rsa; t=s; s=email; p=..."

The last step in protecting yourself and others is the implementation of a DMARC TXT record, for example by using the DMARC Assistant (check).

_dmarc              IN TXT     "v=DMARC1; p=reject;"

The advanced DNS configuration

SRV records specify the server(s) for a specific protocol on your domain. If you want to explicitly announce a service as not provided, give "." as the target address (instead of ""). Please refer to RFC 2782.

_imap._tcp          IN SRV     0 1 143
_imaps._tcp         IN SRV     0 1 993
_pop3._tcp          IN SRV     0 1 110
_pop3s._tcp         IN SRV     0 1 995
_submission._tcp    IN SRV     0 1 587
_smtps._tcp         IN SRV     0 1 465
_sieve._tcp         IN SRV     0 1 4190
_autodiscover._tcp  IN SRV     0 1 443
_carddavs._tcp      IN SRV     0 1 443
_carddavs._tcp      IN TXT     "path=/SOGo/dav/"
_caldavs._tcp       IN SRV     0 1 443
_caldavs._tcp       IN TXT     "path=/SOGo/dav/"


Here are some tools you can use to verify your DNS configuration:


If you are interested in statistics, you can additionally register with the Postmaster Tool by Google and supply a google-site-verification TXT record, which will give you details about spam-classified mails by your domain. This is clearly optional.

@                   IN TXT     "google-site-verification=..."

  1. A Fully Qualified Domain Name (FQDN) is the complete (absolute) domain name for a specific computer or host, on the Internet. The FQDN consists of at least three parts divided by a dot: the hostname (myhost), the domain name (mydomain) and the top level domain in short tld (com). In the example of the hostname would be mx, the domain name 'mailcow' and the tld email