# File lib/openshift-origin-controller/app/models/application.rb, line 973
  def destroy_dns
    reply = ResultIO.new
    self.class.notify_observers(:before_destroy_dns, {:application => self, :reply => reply})
    dns = OpenShift::DnsService.instance
    begin
      dns.deregister_application(@name,@domain.namespace)
      if self.scalable
        # find the group instance where the web-cartridge is residing
        self.group_instance_map.keys.each { |ginst_name|
          ginst = self.group_instance_map[ginst_name]
          ginst.gears.each { |gear|
            dns.deregister_application(gear.name,@domain.namespace)
          }
        }
      end
      dns.publish
    ensure
      dns.close
    end
    self.class.notify_observers(:after_destroy_dns, {:application => self, :reply => reply})  
    reply
  end