DKIM Setup for Mailgun
Configuring Domain Authentication in Mailgun involves adding specific DKIM records to your DNS settings. This process proves to inbox providers that you own the domain and authorizes Mailgun to send authenticated emails on your behalf, ensuring they reach the inbox.
To set up your DKIM record, you will need to add the specific TXT record provided in your Mailgun dashboard.
Step 1: Find your DKIM record
Log in to your Mailgun control panel. Navigate to Sending > Domains and select your domain. Look for the DNS records section to find your DKIM TXT record.
Step 2: Create a new DKIM record
Log in to your DNS hosting provider. Create a new TXT record. In the Host/Name/Alias field, enter the hostname provided by Mailgun (e.g., pic._domainkey or k1._domainkey). In the Value field, paste the long string provided by Mailgun (e.g., k=rsa; p=MIIBIjAN...). Save the TXT record.
Step 3: Records for Subdomains
If you are creating a record for a subdomain, make sure you specify the subdomain part in the Host/Name/Alias field for your DNS provider. For example, if your subdomain is mail.yourdomain.com and Mailgun provides the hostname as pic._domainkey.mail.yourdomain.com, you typically need to enter pic._domainkey.mail into that field.
Step 4: DKIM and DMARC Alignment
To ensure DMARC alignment, the domain in your DKIM signature must match the visible "From" address used in your emails. Mailgun automatically signs your outbound messages with the correct DKIM key once the DNS records are verified in their system, helping you pass authentication checks and improve deliverability.
Successfully setting up your DKIM records for Mailgun is a critical step in securing your domain and improving your email deliverability. Once you save the DNS records, remember to verify them within the Mailgun control panel to ensure your emails are properly authenticated and consistently reach your recipients' inboxes.