diff --git a/internal/nsupdate/nsupdate.go b/internal/nsupdate/nsupdate.go index a1c4b36..9451a16 100644 --- a/internal/nsupdate/nsupdate.go +++ b/internal/nsupdate/nsupdate.go @@ -51,7 +51,9 @@ func (c NsUpdateStruct) UpdateTXT(record, recordType, value string) error { return err } - oldTXT := stdout.String() + oldTXT := strings.TrimLeft(strings.TrimRight(stdout.String(), "\n\""), "\"") + config.Cfg.Log.Debug("existing record", "record", strings.ReplaceAll(oldTXT, `" "`, ``)) + config.Cfg.Log.Debug("new record", "record", strings.ReplaceAll(value, `" "`, ``)) if strings.ReplaceAll(oldTXT, `" "`, ``) != strings.ReplaceAll(value, `" "`, ``) { config.Cfg.Log.Debug("deleting record", "record", record)