mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NEW: Added support for specific TTL when using SPF_BUILDER (#476)
* Added support for specific TTL for SPF_BUILDER * Added updated static.go file * Use IF instead of reading defaultTTL
This commit is contained in:
committed by
Tom Limoncelli
parent
c65ba1c84c
commit
f9df8c744a
@ -645,6 +645,7 @@ var FRAME = recordBuilder('FRAME');
|
||||
// parts: The parts of the SPF record (to be joined with ' ').
|
||||
// label: The DNS label for the primary SPF record. (default: '@')
|
||||
// raw: Where (which label) to store an unaltered version of the SPF settings.
|
||||
// ttl: The time for TTL, integer or string. (default: not defined, using DefaultTTL)
|
||||
// split: The template for additional records to be created (default: '_spf%d')
|
||||
// flatten: A list of domains to be flattened.
|
||||
|
||||
@ -666,7 +667,11 @@ function SPF_BUILDER(value) {
|
||||
// If flattening is requested, generate a TXT record with the raw SPF settings.
|
||||
if (value.flatten && value.flatten.length > 0) {
|
||||
p.flatten = value.flatten.join(',');
|
||||
r.push(TXT(value.raw, rawspf));
|
||||
if (value.ttl) {
|
||||
r.push(TXT(value.raw, rawspf, TTL(value.ttl)));
|
||||
} else {
|
||||
r.push(TXT(value.raw, rawspf));
|
||||
}
|
||||
}
|
||||
|
||||
// If overflow is specified, enable splitting.
|
||||
@ -675,7 +680,11 @@ function SPF_BUILDER(value) {
|
||||
}
|
||||
|
||||
// Generate a TXT record with the metaparameters.
|
||||
r.push(TXT(value.label, rawspf, p));
|
||||
if (value.ttl) {
|
||||
r.push(TXT(value.label, rawspf, p, TTL(value.ttl)));
|
||||
} else {
|
||||
r.push(TXT(value.label, rawspf, p));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user