api: define $ORIGIN and $TTL when adding record

This commit is contained in:
nemunaire 2019-07-16 16:51:27 +02:00
parent e42e078f30
commit 5b12363e06
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package api
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"time"
@ -159,7 +160,7 @@ func addRR(zone string, body io.Reader) Response {
}
}
rr, err := dns.NewRR(urr.RR)
rr, err := dns.NewRR(fmt.Sprintf("$ORIGIN %s\n$TTL %d\n%s", zone, 3600, urr.RR))
if err != nil {
return APIErrorResponse{
err: err,