nameserver.go: delete old record before adding new one
This commit is contained in:
parent
835229c495
commit
2f2ef5b7c7
1 changed files with 1 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ func generateQuery(entry *RRConfig, addr net.IP) string {
|
||||||
fmt.Fprintf(&q, "server %s\n", entry.Nameserver)
|
fmt.Fprintf(&q, "server %s\n", entry.Nameserver)
|
||||||
fmt.Fprintf(&q, "zone %s\n", entry.Zonename)
|
fmt.Fprintf(&q, "zone %s\n", entry.Zonename)
|
||||||
// TODO: check if addr is ipv4 or ipv6 (-> update A or AAAA)
|
// 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, "add %s. %d A %s\n", entry.Recordname, entry.Ttl, addr.String())
|
||||||
fmt.Fprintf(&q, "send\n")
|
fmt.Fprintf(&q, "send\n")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue