Edit SPF Records and DNS Template

mohamadsajedi

Verified User
Joined
Sep 10, 2021
Messages
11
Hey there.
i need to change my dns template and add extra ip address to my spf record for all domains. so i create new path in /usr/local/directadmin/data/templates/custom/ and added new file /usr/local/directadmin/data/templates/custom/dns_spf.conf and add the following line to file :
|DOMAIN|.="v=spf1 a mx ip4:|SERVER_IP||EXTRA_SPF||SPF_IPV6| ip4:X.X.X.X ~all"

after that, i've runned following command and all of my dns zones edited after 1 minutes but still i dont have new ip4 in spf records :
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
how can i solve the problem??
Thanks
 
It might be that the ip4 must be behind the first ip4 and before the extra_spf to work, not sure.
You can do that a lot easier if it's only the ip.

Remove the custom template you made.
Then edit your directadmin.conf and add this line:
extra_spf_value= ip4:x.x.x.x
be aware that you need the space behind the = character.

after that, restart directadmin and after that run the rewrite task queue again.

Let me know if that fixes things for you.
 
thank you my friend... i added new line to directadmin.conf but it is not working ... so you think that where is the problem?
are you directadmin developer?
i think there is some problem for this feature. how can i solve this?
 
Last edited:
so you think that where is the problem?
Did you remove your custom template first?
Did you add a space behind (not before) the = character in directadmin.conf?
Restarted directadmin?
Did you have run the command to rewrite named?

I'm not a DA developper. If you can answer all of the above with yes, then i don't know, then you have to wait for somebody else to answer or ask via a ticket what is going wrong.

Or you can try your custom thing but use it like this, mind the space between the two ipv4's.:
Code:
|DOMAIN|.="v=spf1 a mx ip4:X.X.X.X ip4:|SERVER_IP||EXTRA_SPF||SPF_IPV6| ~all"
not sure if that works, but it might if you put your ip4 as first. Worth trying.
 
I do not know what file should be changed and with what command, if anyone knows, please help. Because I also need to add spf for the added IPs in all the available domains
try this: echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
after updating custom template
 
Back
Top