Types of needed DNS resords (as example I'll use mysubd.webredirect.org):
Adding DNS records
Check that server IP address is not is a spammers list:
https://mxtoolbox.com/blacklists.aspx
https://www.senderscore.org/
https://mxtoolbox.com/blacklists.aspx
https://www.senderscore.org/
If you don't have your own url registered to DNS hosting, then register on https://www.dynu.com (below are for Linux DNS but approach is general to all flavours of DNS).
Add subdomains and needed records:
A record:
- mail.mysubd.webredirect.org IN A yourIPaddress
- Check:
- host mail.mysubd.webredirect.org
- dig -t A mail.mysubd.webredirect.org +short
- mysubd.webredirect.org. IN MX 10 mail.mysubd.webredirect.org.
- Check:
- dig -t MX mysubd.webredirect.org +short
- yourIPaddress IN PTR mail.mysubd.webredirect.org
- But usually this must be set up on your ISP side
- Check:
- host yourIPaddress
- not all servers understand SPF record (it's deprecated) so it's good to use both TXT and SPF records. Below I allow sending mail only from servers in my own subdomain:
- mysubd.webredirect.org. IN TXT "v=spf1 +mx -all"
- mysubd.webredirect.org. IN SPF "v=spf1 +mx -all"
- Options described:
- v=spf1 > use SPF v1
- + > allow
- mx > all servers in mysubd.webredirect.org MX records
- - > deny
- all > all servers not listed in SPF record
- Check:
- create a directory to hold the keys: mkdir -p /etc/mail/dkim
- Generate the keypair and extract the public key out of the private key
- openssl genrsa -out /etc/mail/dkim/mysubd.webredirect.org.key 1024
- openssl rsa -in /etc/mail/dkim/mysubd.webredirect.org.key -pubout -out /etc/mail/dkim/mysubd.webredirect.org.pub
- Add DKIM record:
- 20200514._domainkey.mysubd.webredirect.org. IN TXT "v=DKIM1;k=rsa;p=addContentOfPublicKeyHere;"
- ; is delimiter between parameters
- 20200514 - selector (I used just YYYY.MM.DD of cert generation but you can use anything you want)
- Check:
- _dmarc.mysubd.webredirect.org. IN TXT "v=DMARC1;p=none;pct=100;rua=mailto:postmaster@mysubd.webredirect.org;"
- p > what to do (none - only for reporting / quarantine - adds to spam / reject - rejects mail)
- pct > percentage of mail to be filtered
- rua > daily report mail
- Check:
No comments:
Post a Comment