Remove the SPF record from DNS management

wattie

Verified User
Joined
May 31, 2008
Messages
1,206
Location
Bulgaria
RFC 4408 is obsolete.

The new RFC 7208 instructs SPF records to be created as TXT records.

I think that the SPF record field in the DNS management should at least be marked as "do not use".
 
I already suggested this by email on 17th august last year because of this reason.
Got an answer that they were disabled by default or you can enable them by setting dns_spf=1 in directadmin.conf.
The 18th I responded like this:
I still think they can be removed because according to RFC 7208 they are discontinued.

However, if you disable the SPF record by using dns_spf=0 in directamin.conf and restart DA, the only change made is that you can’t see that SPF line anymore in the DA control panel.

But after that, the line is still present in the named database records, for example mycompany.nl.db in /var/named.

How can we remove them for all domains from the DNS records in /var/named?

I did not get any answer after that anymore. I did not ask again because I already disabled the spf line and shortly after this landed in the hospital and forgot all about it. :)

So anyway, I support your request, it should be removed, also from the dns records in /var/named.

Until that time, set dns_spf=0 in directadmin.conf and restart directadmin, and the SPF line will not be visible in your DNS management anymore, so you will be obliged to use TXT records, just as it always has been.
 
Last edited:
Ah thank you Alex, but I'm no good at perl commands except from copy and pasting them. As far as I can see it you can only clear the SPF record, but I don't understand how to remove it.
Would this be a "clear it" or "remove it" example?
Code:
perl -pi -e 's/\|TXT\|/|DOMAIN|. 14400 IN SPF ""/' named.db
 
Sorry, but what do you try to do? Do you want to update a template? Or existing DNS zones with their *.db files ?
 
I only want to remove the complete SPF record lines (not the spf lines in TXT records) out of the .db files. Or will they dissapear automatically too? Because at first they didn't.
 
It might be something like:

Code:
[COLOR=#000000][FONT=&quot]perl -pi -e 's/.*SPF.*$//' *.db[/FONT][/COLOR][COLOR=#000000][FONT=verdana][/FONT][/COLOR]

Please note I did not test it, so please do run it against files in a test folder (copied from actual named diretory) first.
 
Thank you Alex.
Did not test it yet. Found out that I was the only one who had test it on the servers.
So I enabled SPF txt again, removed the lines in the DNS manager, saved, and then disabled SPF txt again.
And now only the TXT record with the SPF value is present and the SPF line records are gone.
But thanks anyway!
 
Back
Top