nameserver.go: delete old record before adding new one

This commit is contained in:
Thomas Preisner 2021-09-10 13:34:42 +02:00
parent 835229c495
commit 2f2ef5b7c7

View file

@ -40,6 +40,7 @@ func generateQuery(entry *RRConfig, addr net.IP) string {
fmt.Fprintf(&q, "server %s\n", entry.Nameserver)
fmt.Fprintf(&q, "zone %s\n", entry.Zonename)
// TODO: check if addr is ipv4 or ipv6 (-> update A or AAAA)
fmt.Fprintf(&q, "delete %s. A\n", entry.Recordname)
fmt.Fprintf(&q, "add %s. %d A %s\n", entry.Recordname, entry.Ttl, addr.String())
fmt.Fprintf(&q, "send\n")