def index
      validate_arguments!
      domains = api.get_domains_v3_domain_cname(app)

      styled_header("#{app} Heroku Domain")
      heroku_domain = domains.detect { |d| d['kind'] == 'heroku' || d['kind'] == 'default' } # TODO: remove 'default' after API change
      if heroku_domain
        display heroku_domain['hostname']
      else
        output_with_bang "Not found"
      end

      display

      styled_header("#{app} Custom Domains")
      custom_domains = domains.select{ |d| d['kind'] == 'custom' }
      if custom_domains.length > 0
        display_table(custom_domains, ['hostname', 'cname'], ['Domain Name', 'DNS Target'])
      else
        display("#{app} has no custom domains.")
        display("Use `heroku domains:add DOMAIN` to add one.")
      end
    end
def index
      validate_arguments!
      domains = api.get_domains_v3_domain_cname(app)

      styled_header("#{app} Heroku Domain")
      heroku_domain = domains.detect { |d| d['kind'] == 'heroku' || d['kind'] == 'default' } # TODO: remove 'default' after API change
      if heroku_domain
        display heroku_domain['hostname']
      else
        output_with_bang "Not found"
      end

      display

      styled_header("#{app} Custom Domains")
      custom_domains = domains.select{ |d| d['kind'] == 'custom' }
      if custom_domains.length > 0
        display_table(custom_domains, ['hostname', 'cname'], ['Domain Name', 'DNS Target'])
      else
        display("#{app} has no custom domains.")
        display("Use `heroku domains:add DOMAIN` to add one.")
      end
    end
domains

 list domains for an app

Examples:

 $ heroku domains
 === example Heroku Domain
 example.herokuapp.com

 === example Custom Domains
 Domain Name  DNS Target
 -----------  ---------------------
 example.com  example.herokuapp.com