1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

Addressed code review plus missed updates

This commit is contained in:
Eri Bastos
2020-04-28 18:40:04 -04:00
parent 690e138164
commit e8ce3434ee
3 changed files with 12 additions and 6 deletions

View File

@@ -81,12 +81,17 @@ func (handler *Handler) UpdateIP(hostname, currentIP, lastIP string) {
// updateDNS can add or remove DNS records.
func (handler *Handler) updateDNS(dns, ip, hostname, action string) {
ipType := "A"
if strings.ToUpper(handler.Configuration.IPType) == godns.IPV6 {
ipType = "AAAA"
}
// Generates UUID
uid, _ := uuid.NewRandom()
values := url.Values{}
values.Add("record", hostname)
values.Add("key", handler.Configuration.LoginToken)
values.Add("type", "A")
values.Add("type", ipType)
values.Add("unique_id", uid.String())
switch action {
case "remove":