Stay organized with collectionsSave and categorize content based on your preferences.
Learn how to use wildcard DNS records to configure a domain for your cluster.
You must configure a domain to enable your services to accept requests and allow
you access for testing purposes.
By default, your Knative serving clusters use theexample.combase
domain and do not allow requests to your services. For example, sending requests
tohttp://{service}.{namespace}.example.comfails.
To enable the services in your cluster to accept requests, you must configure your
domain to use either of the following:
If you already have a domain you want to use for testing purposes, or if you
don't mind purchasing a domain for testing purposes, you can set the default
domain to use your own domain. A custom domain offers better reliability for
testing.
Getting the external IP address
Before proceeding, you must obtain the external IP address of the load balancer
service created for the Istio ingress controller.
Console
To get the load balancer's external IP address from the Google Cloud console:
Identify the service that is your cluster's Istio
ingress controller. The service'sTypewill beExternal load
balancer. The following table shows the service's name based on
your cluster's version:
Once you've found your cluster's Istio ingress controller, copy itsEndpoint. This will be the IP address without the port
number. For example, you might see00.000.000.000:11listed as an
endpoint, but you only need to copy00.000.000.000.
Command line
To get the external IP for the Istio ingress gateway:
kubectlgetsvcistio-ingress-ngke-system
where the resulting output looks something like this:
TheEXTERNAL-IPfor the Load Balancer is the IP address you must use.
If you're using a wildcard service, you'll need the external IP address when
you edit the cluster configuration. If you're using your own custom domain,
you'll need the external IP address to create or update a record at your domain
registrar.
Configuring your cluster's domain
Knative serving uses theconfig-domainConfigMap to define the base
domain for all services deployed to the cluster. The command to edit this
configuration will vary depending on whether you use a wildcard DNS service
or a custom domain that you own. You can repeat these steps with different
values if you want to update the default cluster domain in the future.
Testing with a DNS wildcard service
xip.iois used to demonstrate how to configure your domain to use a DNS
wildcard service, but you can replace it with whatever service you choose.
Console
To change the default base domain fromexample.comto one of the DNS
wildcard services (xip.iofor example) in the Google Cloud console:
Go to the Knative servingDomain mappingspage in the
Google Cloud console:
Replace[DOMAIN]with your own domain, for example,mydomain.comThe command above removesexample.comfrom the ConfigMap and addsmydomain.comas the default base domain. You can repeat this command if you
want to change this again to some other domain.
The remaining steps must be performed on your domain registrar's website:
Log in to your account at your domain registrar and then open the DNS
configuration page.
Locate the host records section of your domain's configuration page and
then add the resource records you need.
To add a DNS record to the account at the DNS provider:
Select the record typeA.
Supply the wildcard*, as shown in the following example:
Save your changes in the DNS configuration page of your domain's account.
In most cases, it takes only a few minutes for these changes to take
effect, but in some cases it can take up several hours, depending on the
registrar, and on theTime-To-Live (TTL)of any previous DNS records for your domain.
After updating your DNS records and pointing them to your cluster, your service
is available at{service-name}.{namespace}.{your-domain}.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eTo allow services in your Knative cluster to accept requests, you must configure your domain to use either a free DNS wildcard service or a custom domain.\u003c/p\u003e\n"],["\u003cp\u003eWildcard DNS records are suitable for testing purposes, but not recommended for production due to reliability issues, and in production you should map a custom domain to enable HTTPS and TLS.\u003c/p\u003e\n"],["\u003cp\u003eTo use a wildcard DNS service, such as \u003ccode\u003exip.io\u003c/code\u003e, you need to get the external IP address of your cluster's Istio ingress controller and then update the \u003ccode\u003econfig-domain\u003c/code\u003e ConfigMap to include the wildcard service's domain with the IP address.\u003c/p\u003e\n"],["\u003cp\u003eIf using a custom domain for testing, you need to update the cluster's \u003ccode\u003econfig-domain\u003c/code\u003e ConfigMap with your domain and also create a wildcard A record (\u003ccode\u003e*\u003c/code\u003e) in your domain registrar's DNS settings, pointing it to the cluster's external IP address.\u003c/p\u003e\n"],["\u003cp\u003eThe default base domain in Knative serving clusters is \u003ccode\u003eexample.com\u003c/code\u003e, and using a command or the console you can change it to any wildcard DNS site or custom domain, but you need to install and configure Google Cloud CLI and kubectl before you begin.\u003c/p\u003e\n"]]],[],null,["# Using a test domain\n\nLearn how to use wildcard DNS records to configure a domain for your cluster.\nYou must configure a domain to enable your services to accept requests and allow\nyou access for testing purposes.\n| **Important:** For production, [map a custom domain](/anthos/run/archive/docs/mapping-custom-domains) to [enable HTTPS and use automatic TLS certificates](/anthos/run/archive/docs/managed-tls).\n\nBy default, your Knative serving clusters use the `example.com` base\ndomain and do not allow requests to your services. For example, sending requests\nto `http://{service}.{namespace}.example.com` fails.\n\nTo enable the services in your cluster to accept requests, you must configure your\ndomain to use either of the following:\n\n- Free DNS wildcard service\n- Custom domain you own. For details, see [Mapping custom domains](/anthos/run/archive/docs/mapping-custom-domains).\n\nDNS wildcard records should be used for testing only due to the issues around the\nreliability of requests. Learn more about\n[wildcard DNS records](https://en.wikipedia.org/wiki/Wildcard_DNS_record).\n\nBefore you begin\n----------------\n\nMake sure you have installed and configured\n[Google Cloud CLI and kubectl](/anthos/run/archive/docs/setup#setting_up_gcloud).\n\nChoosing between a wildcard DNS service and a custom domain\n-----------------------------------------------------------\n\nWhen you are developing and testing, you can change the default domain to use a\nwildcard DNS test site. Examples include:\n\n- [nip.io](http://nip.io/)\n- [xip.io](http://xip.io/)\n- [sslip.io](https://sslip.io/)\n\nIf you already have a domain you want to use for testing purposes, or if you\ndon't mind purchasing a domain for testing purposes, you can set the default\ndomain to use your own domain. A custom domain offers better reliability for\ntesting.\n\nGetting the external IP address\n-------------------------------\n\nBefore proceeding, you must obtain the external IP address of the load balancer\nservice created for the Istio ingress controller.\n**Note:** When you create a GKE cluster enabled for Knative serving, an Istio ingress controller creates a Google Cloud Network Load Balancer with a public IP address. \n\n### Console\n\nTo get the load balancer's external IP address from the Google Cloud console:\n\n1. Go to the GKE page in the Google Cloud console:\n\n [Go to the GKE page](https://console.cloud.google.com/kubernetes)\n\n2. Click **Services and ingress**.\n\n3. Identify the service that is your cluster's Istio\n ingress controller. The service's **Type** will be **External load\n balancer**. The following table shows the service's name based on\n your cluster's version:\n\n4. Once you've found your cluster's Istio ingress controller, copy its\n **Endpoint** . This will be the IP address without the port\n number. For example, you might see `00.000.000.000:11` listed as an\n endpoint, but you only need to copy `00.000.000.000`.\n\n### Command line\n\nTo get the external IP for the Istio ingress gateway: \n\n```bash\nkubectl get svc istio-ingress -n gke-system\n```\nwhere the resulting output looks something like this: \n\n```bash\nNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)\nistio-ingress LoadBalancer XX.XX.XXX.XX pending 80:32380/TCP,443:32390/TCP,32400:32400/TCP\n```\nThe \u003cvar translate=\"no\"\u003eEXTERNAL-IP\u003c/var\u003e for the Load Balancer is the IP address you must use.\n\nIf you're using a wildcard service, you'll need the external IP address when\nyou edit the cluster configuration. If you're using your own custom domain,\nyou'll need the external IP address to create or update a record at your domain\nregistrar.\n\nConfiguring your cluster's domain\n---------------------------------\n\nKnative serving uses the `config-domain` ConfigMap to define the base\ndomain for all services deployed to the cluster. The command to edit this\nconfiguration will vary depending on whether you use a wildcard DNS service\nor a custom domain that you own. You can repeat these steps with different\nvalues if you want to update the default cluster domain in the future.\n\n### Testing with a DNS wildcard service\n\n`xip.io` is used to demonstrate how to configure your domain to use a DNS\nwildcard service, but you can replace it with whatever service you choose. \n\n### Console\n\nTo change the default base domain from `example.com` to one of the DNS\nwildcard services (`xip.io` for example) in the Google Cloud console:\n\n1. Go to the Knative serving **Domain mappings** page in the\n Google Cloud console:\n\n [Go to Domain mappings](https://console.cloud.google.com/kubernetes/run/domains)\n2. Select **Add mapping \\\u003e Add cluster default domain**\n\n3. Select the checkbox next to \"Apply this domain mapping to all\n Knative serving services deployed to this cluster.\"\n\n4. Select your cluster from the drop-down menu.\n\n5. In the **Domain** field, enter \u003cvar translate=\"no\"\u003e[EXTERNAL-IP].xip.io\u003c/var\u003e. Replace:\n\n - \u003cvar translate=\"no\"\u003e[EXTERNAL-IP]\u003c/var\u003e with the Load Balancer [external IP address](#external_ip).\n\n - \u003cvar translate=\"no\"\u003exip.io\u003c/var\u003e with the wildcard DNS site you are using.\n\n### Command line\n\nTo change the default base domain from `example.com` to one of the DNS\nwildcard sites (`xip.io` for example), use the command: \n\n```bash\nkubectl patch configmap config-domain --namespace knative-serving --patch \\\n '{\"data\": {\"example.com\": null, \"\u003cvar translate=\"no\"\u003e[EXTERNAL-IP].xip.io\u003c/var\u003e\": \"\"}}'\n```\n\nReplace\n\n- \u003cvar translate=\"no\"\u003e[EXTERNAL-IP]\u003c/var\u003e with the Load Balancer [external IP address](#external_ip).\n- \u003cvar translate=\"no\"\u003exip.io\u003c/var\u003e with the wildcard DNS site you are using.\n\nYour service is now available at `{service-name}.{namespace}.{[EXTERNAL-IP].xip.io}`.\n\n### Testing with a custom domain\n\nIf you want to use a custom domain of your own for testing, the following steps\nwill help you get set up.\n\nFirst, update the cluster's ConfigMap to point to your domain: \n\n### Console\n\n1. Go to the Knative serving **Domain mappings** page in the\n Google Cloud console:\n\n [Go to Domain mappings](https://console.cloud.google.com/kubernetes/run/domains)\n2. Select **Add mapping \\\u003e Add cluster default domain**\n\n3. Select the checkbox next to \"Apply this domain mapping to all\n Knative serving services deployed to this cluster.\"\n\n4. Select your cluster from the drop-down menu.\n\n5. In the **Domain** field, enter your domain name. For example,\n `example.com`.\n\n### Command line\n\nSpecify your custom domain using the command: \n\n```bash\nkubectl patch configmap config-domain --namespace knative-serving --patch \\\n'{\"data\": {\"example.com\": null, \"\u003cvar translate=\"no\"\u003e[DOMAIN]\u003c/var\u003e\": \"\"}}'\n```\n\nReplace \u003cvar translate=\"no\"\u003e[DOMAIN]\u003c/var\u003e with your own domain, for example, `mydomain.com`\nThe command above removes `example.com` from the ConfigMap and adds\n`mydomain.com` as the default base domain. You can repeat this command if you\nwant to change this again to some other domain.\n\nThe remaining steps must be performed on your domain registrar's website:\n\n1. Log in to your account at your domain registrar and then open the DNS\n configuration page.\n\n2. Locate the host records section of your domain's configuration page and\n then add the resource records you need.\n\n 1. To add a DNS record to the account at the DNS provider:\n\n - Select the record type `A`.\n - Supply the wildcard `*`, as shown in the following example:\n\n 2. Save your changes in the DNS configuration page of your domain's account.\n In most cases, it takes only a few minutes for these changes to take\n effect, but in some cases it can take up several hours, depending on the\n registrar, and on the [Time-To-Live (TTL)](https://support.google.com/a/answer/48090)\n of any previous DNS records for your domain.\n\nAfter updating your DNS records and pointing them to your cluster, your service\nis available at `{service-name}.{namespace}.{your-domain}`."]]