{"id":1192,"date":"2024-07-05T07:01:10","date_gmt":"2024-07-05T07:01:10","guid":{"rendered":"https:\/\/zalvis.com\/docs\/?p=1192"},"modified":"2024-07-05T07:01:10","modified_gmt":"2024-07-05T07:01:10","slug":"create-an-spf-record-for-a-domain","status":"publish","type":"post","link":"https:\/\/zalvis.com\/docs\/create-an-spf-record-for-a-domain.html","title":{"rendered":"Create an SPF record for a domain"},"content":{"rendered":"<p>SPF stands for Sender Policy Framework, and is a method by which the administrator of a domain explicitly specifies which mailservers are allowed to send mail for his domain. As this is just a TXT record that is put into the domains DNS zone file, the setup is fairly straightforward. A very basic SPF for mydomain.com might look like this:<\/p>\n<p><code>mydomain.com IN TXT \"v=spf1 a mx ~all\"<\/code><\/p>\n<p>The above specifes that this is an SPF record for mydomain.com:<\/p>\n<p><strong>v=spf1 \u2013 a<\/strong> required header that indicates this is an spf record<br \/>\n<strong>a \u2013<\/strong> the A record for mydomain.com is allowed to send <a>email<\/a><br \/>\n<strong>mx \u2013 <\/strong>the MX record for mydomain.com is allowed to send <a>email<\/a><\/p>\n<p><strong>~all \u2013<\/strong> all other mailservers trying to send mail will return a code of \u201csoftfail\u201d. The mail will still go through, however it will be a suspect message<\/p>\n<p>If you wished to allow another server to send mail through that had the hostname of mail2.mydomain.com, you would modify the record thusly:<\/p>\n<p><code>mydomain.com IN TXT \"v=spf1 a mx a:mail2.mydomain.com ~all\"<\/code><\/p>\n<p>Also, if you wish to give a hard fail, and only allow those servers to send mail, the record would look like:<\/p>\n<p><code>mydomain.com IN TXT \"v=spf1 a mx a:mail2.mydomain.com -all<\/code><\/p>\n<div class=\"lhgbh69f240383b12d\" >If you enjoyed this article, then you\u2019ll love Zalvis's Cloud Hosting platform. Turbocharge your website and get 24\/7 support from our veteran team. Our world-class hosting infrastructure focuses on auto-scaling, performance, and security. Let us show you the Zalvis difference! <a href=\"https:\/\/zalvis.com\/\">Check out our services.<\/a><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.lhgbh69f240383b12d {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.lhgbh69f240383b12d {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.lhgbh69f240383b12d {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.lhgbh69f240383b12d {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.lhgbh69f240383b12d {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n","protected":false},"excerpt":{"rendered":"<p>SPF stands for Sender Policy Framework, and is a method by which the administrator of a domain explicitly specifies which mailservers are allowed to send mail for his domain. As this is just a TXT record that is put into the domains DNS zone file, the setup is fairly straightforward. A very basic SPF for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1192","post","type-post","status-publish","format-standard","hentry","category-email"],"_links":{"self":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/1192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/comments?post=1192"}],"version-history":[{"count":2,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/1192\/revisions"}],"predecessor-version":[{"id":1194,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/1192\/revisions\/1194"}],"wp:attachment":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/media?parent=1192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/categories?post=1192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/tags?post=1192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}