title: Too many DNS lookups in an SPF record
body: <p>My website needs to send out emails with Google Apps, SendGrid and MailChimp services. Google Apps is used to receive and read incoming email to my domain.</p>
  
  <p>I need to set the SPF record for my domain. The following is syntactically correct (not sure about A and MX tokens):</p>
  
  <blockquote>
    <p>"v=spf1 a mx include:<strong>_spf.google.com</strong> include:<strong>servers.mcsv.net</strong>
    include:<strong>sendgrid.net</strong> ~all"</p>
  </blockquote>
  
  <p>But if I test it with <a href="http://www.kitterman.com/getspf2.py">http://www.kitterman.com/getspf2.py</a> I get </p>
  
  <blockquote>
    <p><strong>PermError SPF Permanent Error: Too many DNS lookups</strong></p>
  </blockquote>
  
  <p>Similar problem as
  <a href="http://www.onlineaspect.com/2009/03/20/too-many-dns-lookups-in-an-spf-record/">http://www.onlineaspect.com/2009/03/20/too-many-dns-lookups-in-an-spf-record/</a></p>
  
  <p>How can I optimize/rewrite my SPF record?</p>