How To Add SPF Record in Plesk 7

If anyone is familiar with SPF (Sender Policy Framework) you’ll know that it is a tool to validate that the server sending an email is allowed to send email on behalf of that domain. It is a small TXT record to add to your DNS. Also if you are familiar with the Plesk DNS manager you’ll also realise that you can’t add TXT records via PSA. However you CAN implement a TXT record to a domain in Plesk relatively easily.

HOW-TO add the TXT record

1) You’ll need to get access to the PSA database in MySQL. This is the internal database used by Plesk so be careful! I make no representations that this information I’m giving is accurate… so basically if it mucks up don’t blame me!

2) To get access I downloaded PHPMyAdmin ( and installed it in a password protected directory on my server with the admin username and password in the config file. It is also possible to grant one of your other usernames permission to the PSA database if you wish but the first method is probably easier.

3) OK so assuming you are familiar with PHPMyAdmin and you have selected the PSA database, first BACKUP the PSA database using the EXPORT tool and save a copy of it, in case things go wrong!

4) Browse the ‘domains’ table and look for the domain you wish to add the SPF for and make a note of the value in the ‘id’ column. This is the domain id and we will need this to add the SPF record.

5) The DNS records are all stored in the ‘dns_recs’ table so go to the STRUCTURE of the table and you’ll need to CHANGE the ‘type’ entry (as this is an ENUM it will only allow certain values).

6) Change the values from ‘NS’,’A’,’CNAME’,’MX’,’PTR’,’none’ to ‘NS’,’A’,’CNAME’,’MX’,’PTR’,’TXT’,’none’ and save

7) Now we need to INSERT into ‘dns_recs’. In the column ‘dom_id’ add in the domain id we looked up earlier. Select the type as ‘TXT’ from the drop down list. Add into the ‘val’ column the SPF text that you have generated at e.g. "v=spf1 a mx ptr -all"

 You can ignore the other fields and just save this new entry.

9) Now this will have changed your DNS definitions for that domain but not actually the DNS itself. To do that go into the PSA DNS manager for your domain. Add a dummy CNAME record and delete it again. This will update your DNS records and add your SPF for you.

10) To check that it has indeed been added go to and do a check for your domain as this report actually looks for SPF records now.

Note: It is important you backup your PSA database incase you make mistakes. Also note that apparently BIND has a problem with TXT records being the last. I didn’t come across this problem when I tried however.

Kaynak: the planet forums

Belgeci , 2422 belge yazmış

Cevap Gönderin