Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Please help to set up a SPF record. I have found several SPF record generators but all questions are too complicated and I am afraid to make something wrong.

I want to allow sending mail only from:

1) from all IP addresses that are listed as A records for this domain. 2) from other servers in my data center in the same IP range 2) from Gmail servers - my domain is set up to use Gmail (all MX records are Google's MX records). Google's instructions say to include include:_spf.google.com ~all in the SPF record. Do I need mx in this case?

Which is correct:

v=spf1 a ip4:111.222.333.0/24 include:_spf.google.com ~all

or

v=spf1 mx a ip4:111.222.333.0/24 include:_spf.google.com ~all

Thanks.

share|improve this question

migrated from stackoverflow.com Oct 12 '11 at 14:35

This question came from our site for professional and enthusiast programmers.

1 Answer 1

The first is correct for testing. The second is unnecessary because of the Google include.

When you're done testing (send an e-mail from all authorized servers to a test service) change the "~all" to "-all". The tilde indicates that you're testing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.