diff options
Diffstat (limited to 'src/resolve/resolved-dns-answer.c')
-rw-r--r-- | src/resolve/resolved-dns-answer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-answer.c b/src/resolve/resolved-dns-answer.c index b6883a3aba..7c4ab18b58 100644 --- a/src/resolve/resolved-dns-answer.c +++ b/src/resolve/resolved-dns-answer.c @@ -97,13 +97,15 @@ int dns_answer_add(DnsAnswer *a, DnsResourceRecord *rr) { return 1; } -int dns_answer_add_soa(DnsAnswer *a, const char *name) { +int dns_answer_add_soa(DnsAnswer *a, const char *name, uint32_t ttl) { _cleanup_(dns_resource_record_unrefp) DnsResourceRecord *soa = NULL; soa = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_SOA, name); if (!soa) return -ENOMEM; + soa->ttl = ttl; + soa->soa.mname = strdup(name); if (!soa->soa.mname) return -ENOMEM; @@ -116,7 +118,7 @@ int dns_answer_add_soa(DnsAnswer *a, const char *name) { soa->soa.refresh = 1; soa->soa.retry = 1; soa->soa.expire = 1; - soa->soa.minimum = 1; + soa->soa.minimum = ttl; return dns_answer_add(a, soa); } |