I’m running into a DNS setup problem with my Mailgun configuration. Mailgun wants me to create a TXT record for mail.mysite.com containing v=spf1 ... and also set up a CNAME record for sender.mail.mysite.com pointing to mailgun.org.
The domain verification went through fine on Mailgun’s end. But now when I try to send messages, some email servers are bouncing them back saying ‘Sender address rejected: Domain not found’. I think this happens because mail.mysite.com doesn’t actually resolve to anything. I need a CNAME record for it, but I can’t add one since there’s already a TXT record using that same subdomain.
Is there a way to move the SPF record (v=spf1 stuff) to a different TXT entry? That would let me free up the mail. subdomain for a CNAME record so these strict mail servers will accept my emails.
The problem is that mail servers do reverse DNS lookups and expect your sending domain to actually exist. I hit this same issue when I switched to Mailgun six months ago. Here’s what fixed it for me: create separate subdomains instead of making mail.mysite.com do everything. I set up mg.mysite.com for Mailgun’s CNAME stuff and left the SPF record on my main sending domain. This satisfied Mailgun’s requirements and the picky receiving servers. Bounces stopped right away. Just make sure your DNS provider can handle subdomains before you start.
u can have both TXT and CNAME for the same subdomain, but if mail.mysite.com ain’t resolving, try setting up an A record or a valid CNAME. and yeah, dont forget to check DNS propagation, it takes some time to update everywhere!
had the same issue w/ Mailgun too. I just made an MX record for mail.mysite.com pointing to a dummy mail server - even an A record to 127.0.0.1 works. it keeps your TXT intact while making the subdomain resolve. some servers just need something to ping, doesn’t gotta work.
You can’t move the SPF record; it must remain on the domain sending emails. This is a common DNS issue. Having both a CNAME and TXT record on the same subdomain violates DNS standards and results in conflicts. I faced this situation last year and resolved it by using an A record for mail.mysite.com pointed to an actual IP address. This allows the TXT record to function correctly and eliminates those ‘Domain not found’ bounce messages from strict mail servers.