All Products
Search
Document Center

Alibaba Cloud Service Mesh:Set a custom domain name in Knative on ASM

Last Updated:Mar 11, 2026

Every Knative Service receives a DNS name in the format {service-name}.{namespace}.{domain-suffix}. The default domain suffix is example.com -- a service named helloworld-go in the default namespace resolves to helloworld-go.default.example.com. To use a domain that reflects your organization, replace the default suffix in the Service Mesh (ASM) console. Knative automatically updates all existing Services and Routes to use the new domain.

Prerequisites

Before you begin, make sure that you have:

Change the default domain suffix

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of your ASM instance. In the left-side navigation pane, choose Ecosystem > Knative on ASM.

  3. In the Knative components section of the Knative on ASM page, click edit to the right of Service domain name suffix.

  4. Enter your custom domain -- for example, aliyun.com -- and then click confirm edit.

Verify the custom domain

After the domain suffix changes, Knative automatically updates all Knative Services and Routes based on the ConfigMap. Each Knative Service receives a new hostname. For example, the helloworld-go service in the default namespace with the domain set to aliyun.com becomes helloworld-go.default.aliyun.com.

Test locally with the hosts file

Add an entry to your local hosts file that maps the new hostname to your ASM gateway IP address. Replace <gateway-ip> with the actual IP address. To find the gateway address, see Query the gateway address.

<gateway-ip> helloworld-go.default.aliyun.com

Send a request with curl:

curl http://helloworld-go.default.aliyun.com

Expected output:

Hello Knative!

You can also open https://helloworld-go.default.aliyun.com in a browser.

What's next