Skip to content

Commit ee77e97

Browse files
committed
Fix nsupdate call if zone is empty
1 parent 9996546 commit ee77e97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rest-api/nsupdate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ func (nsupdate *NSUpdate) UpdateRecord(r RecordUpdateRequest) {
112112
}
113113

114114
nsupdate.write("server %s\n", appConfig.Server)
115-
nsupdate.write("zone %s\n", appConfig.Zone)
115+
if appConfig.Zone != "" {
116+
nsupdate.write("zone %s\n", appConfig.Zone)
117+
}
116118
nsupdate.write("update delete %s %s\n", fqdn, r.addrType)
117119
nsupdate.write("update add %s %v %s %s\n", fqdn, appConfig.RecordTTL, r.addrType, escape(r.ipaddr))
118120
nsupdate.write("send\n")

0 commit comments

Comments
 (0)