شيما دهباشي

شركت رادكام
34 - پیام , 597 - نظر

Adding new SPF record to all domains in Plesk 7.5.4 reloaded(Linux)

1- Backup psa database
mysqldump -u user -p password psa > pleskbackup.Bak;

2- Then create suitable record needed for adding new dns records.All dns records are stored in dns_recs table therefore the only thing you need to do is adding txt record for each domain . I wanted to add a TXT record for each domain in order to show that SPF has been enabled for our domains.

insert into dns_recs (dom_id, type, host, val)
SELECT d.id as dom_id
,'TXT' as type
,concat(name,'.') as host   // Update domain name in order to be in acceptable format
,'"v=spf1 mx -all"' as val      // mechanism
FROM `domains` d;

New record will be added successfully to each domain,but it's not enough. we have to update DNS by using dnsmng.exe .This command works for a domain as an input, therefore , we need to write a script which mysql help us to create it :

#vi query.txt
and use this query :
select concat('./dnsmng update ', name) from domains;
after creating the query , execute it:
mysql -uadmin -ppassword psa<query.txt> output.txt;

Now open output.txt and modify in order to tells the system to use Bash to run this script and correct path.

#!/bin/bash
cd /usr/local/psa/admin/sbin
 and at the end make it executeable and execute output.txt

Then you can check new zone files by nslookup and after it you can test spf record and all required issues by using tools provided by http://spf.pobox.com/

Thanks to http://radcom.ir/weblog/majid

ارسال شده در تاریخ ۷ تیر ۱۳۸۵ - 11:58 صبح

نظرات

هنوز هیچ نظری ارسال نشده است

ارسال نظرات

عنوان:  
نام:  
آدرس الکترونیکی:
زبان:
توضیح:  
لطفا متن مقابل را در زیر وارد کنید
(کوچک یا بزرگ بودن حروف مهم نیست)