You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:为基于WHM/cPanel的邮件服务器配置各类DNS记录

Hey there! Let's get your email setup sorted for mysite.com on WHM/cPanel. You’re already off to a good start with planning the A record for mail.mysite.com—here’s the full breakdown of what else you need to do, step by step:

1. Complete DNS Records at Your Provider

Since your DNS is managed by dnsprovider.com, log into their dashboard and add these critical records alongside your existing mail.mysite.com A record:

  • MX Record: Set mysite.com to point to mail.mysite.com with a priority of 0 (this is the primary mail exchanger; use the lowest priority number if you add backup MX records later).
  • SPF TXT Record: For mysite.com, add a record with the value:
    v=spf1 +a +mx +ip4:111.222.333.444 +include:cpanel.net ~all
    
    The ~all means "soft fail" (it flags unauthenticated mail but still delivers it)—you can switch to -all (strict fail) once you confirm everything works. Adjust include:cpanel.net if your WHM/cPanel uses a custom relay, but this is standard for most setups.
  • DKIM TXT Record: You’ll get this directly from cPanel. Log into your cPanel account, navigate to Email > Authentication, find the DKIM section, and copy the generated record. Add it to your DNS with the name provided (usually something like default._domainkey.mysite.com) and the corresponding value.
  • DMARC TXT Record: Add a record for _dmarc.mysite.com with:
    v=DMARC1; p=none; sp=none; rua=mailto:dmarc@mysite.com
    
    Start with p=none to monitor unauthenticated mail without blocking it. Once you’re confident in your setup, switch to p=quarantine or p=reject to enforce stricter rules.
2. cPanel/WHM Server Configuration Checks

Now head over to your WHM/cPanel to make sure the server is set up to handle mail correctly:

  • Confirm Exim is Running: Log into WHM, go to Service Configuration > Service Manager, and ensure the Exim Mail Server is enabled and active.
  • Set Up Email Accounts: In cPanel, go to Email > Email Accounts and create the addresses you need (e.g., support@mysite.com or admin@mysite.com).
  • Configure Email Routing: In cPanel, navigate to Email > Email Routing. For mysite.com, select Local Mail Exchanger—this tells the server to process mail locally instead of forwarding it to an external service.
  • Reverse DNS (PTR) Record: This is critical to avoid your mail being marked as spam. You’ll need to set this up with your server’s hosting provider (not your DNS registrar). The PTR record should map your server IP 111.222.333.444 to mail.mysite.com. Most hosts let you set this in their server dashboard or via a support ticket.
3. Test and Troubleshoot

Once all records are in place (give DNS up to 24 hours to propagate, though it often happens faster), test your setup:

  • Send/Receive Test Emails: Send a message from your new cPanel email to an external account (Gmail, Outlook, etc.) and vice versa to confirm both incoming and outgoing mail works.
  • Verify Records via Command Line: Use dig on your server to check if your DNS records are propagating correctly:
    • Check SPF: dig TXT mysite.com
    • Check DKIM: dig TXT default._domainkey.mysite.com
    • Check MX: dig MX mysite.com
  • Check Exim Logs: If you run into issues, review the Exim logs in WHM at Service Configuration > Mail Server Configuration > View Logs, or via SSH with:
    tail -f /var/log/exim_mainlog
    
    This will show real-time details about incoming/outgoing mail errors.

One final note: Make sure your server IP isn’t listed on any spam blacklists. If it is, request removal (your hosting provider can help with this, or you can check via command-line tools).

内容的提问来源于stack exchange,提问作者HenryM

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:46:45