code: func (api OrganizationsAPI) UpdateOrganizationDns(w http.ResponseWriter, r *http.Request) {
  	globalID := mux.Vars(r)["globalid"]
  	oldDNS := mux.Vars(r)["dnsname"]
  
  	var dns DnsAddress
  
  	if err := json.NewDecoder(r.Body).Decode(&dns); err != nil {
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  	if !dns.Validate() {
  		log.Debug("Invalid DNS name: ", dns.Name)
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  
  	orgMgr := organization.NewManager(r)
  	organisation, err := orgMgr.GetByName(globalID)
  	if err != nil {
  		if err == mgo.ErrNotFound {
  			http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
  		} else {
  			handleServerError(w, "getting organization", err)
  		}
  		return
  	}
  	exists := false
  	for _, d := range organisation.DNS {
  		if d == dns.Name {
  			http.Error(w, http.StatusText(http.StatusConflict), http.StatusConflict)
  			return
  		}
  		if d == oldDNS {
  			exists = true
  		}
  	}
  	if !exists {
  		http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
  		return
  	}
  	err = orgMgr.UpdateDNS(organisation, oldDNS, dns.Name)
  
  	if err != nil {
  		log.Error("Error updating DNS name", err.Error())
  		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
  		return
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  
  	w.WriteHeader(http.StatusOK)
  	json.NewEncoder(w).Encode(dns)
  }
docs: // UpdateOrganizationDns is the handler for PUT /organizations/{globalid}/dns/{dnsname}
  // Updates an existing DNS name associated with an organization