HenryM
HenryM

Reputation: 5793

Setting up various DNS records for my mail server with external DNS

I have a domain name, mysite.com registered with a provider at ns1.dnsprovider.com and ns2.dnsprovider.com.

mysite.com is a Wordpress site on WHM/cPanel at IP: 111.222.333.444

I can set my DNS records at DNSProvider to point at 111.222.333.444 for the websites - no problem. I also need to set up email facilities.

This I'm struggling with. I'm simply running the standard Exim package in cPanel.

I figure I need to set up an A record mail.mysite.com for IP 111.222.333.444 but I also need to set up MX records. Would this be to mail.mysite.com with priority 0 and 10?

Also what about DKIM and SPF records? What would I need to enter?

Upvotes: 0

Views: 307

Answers (1)

Lanexbg
Lanexbg

Reputation: 1132

First a quick note: If the mail server is on the same IP address you do not need the extra A record, since there is already an A record the MX record can use. As for the MX record, it depends on what the mail addresses will be. For the one you mentioned the mail addresses will be [email protected], if you want them to be [email protected], then the MX record must be for example.com, like this:

@ MX 10 mail.example.com.

Where mail.example.com is the extra A record you wanted to create, you can also point the record to example.com, since it has an A record pointed to the IP of the mail server.

Now for the SPF record it depends on which servers will be send mails on behalf of your domain. If only your server (this includes your web site, since they are on the same IP) the SPF record can be like this:

@ TXT "v=spf1 a -all"

This allows the IP of your A record to send mails and "forbids" everybody else.

The DKIM record is in the following format:

default._domainkey TXT "v=DKIM1; p=yourPublicKey"

You should generate yourPublicKey and also a private key, with which you will sign your mails (note that you can simply skip the whole DKIM part)

Upvotes: 2

Related Questions