Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex API Gateway
  • Getting started
    • All guides
    • Creating an API gateway
      • Updating API gateways and their specifications
      • Adding a domain
      • Specifying a cloud network
      • Setting up variables
      • Setting up a canary release
      • Viewing monitoring charts
      • Removing a domain
      • Migration to the ru-central1-d availability zone
      • Deleting an API gateway
    • Viewing operations with service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Managing an API gateway
  3. Adding a domain

Connecting a domain

Written by
Yandex Cloud
Updated at November 14, 2024

You can connect your own domain to access the API gateway. You can connect a wildcard domain, e.g., *.example.com, to the API gateway for it to handle requests for all example.com subdomains. You can also connect multiple domains. The domain will be identified by the Host header.

Warning

If a third-party DNS provider manages your domain, it must be a third-level domain or lower. For example, you can connect the www.example.com domain, but not example.com. This has to do with how CNAME records are processed on DNS hostings. Learn more in RFC 1912, section 2.4.

To use the second-level domain, such as example.com, delegate it to Yandex Cloud DNS and create an ANAME record in the DNS zone.

To connect a domain to an API gateway:

Management console
API
  1. Add a CNAME record to your DNS provider or to your own DNS server:

    <domain> IN CNAME <API_gateway_service_domain>
    

    To find out an API gateway's service domain:

    1. Go to the management console.
    2. Select the folder where the API gateway is located, and in the service list, select API Gateway.
    3. Select the API gateway.
    4. You can see the service domain in the Default domain field.

    Domain names must end in a dot.

    To use a top-level domain or higher, delegate it to Yandex Cloud DNS and create an ANAME record in the DNS zone. You can create a record in Yandex Cloud DNS both before and after creating the domain. For more information, see step 6.

  2. In the management console, select the folder containing the API gateway.

  3. In the list of services, select Certificate Manager and:

    1. Add a Let's Encrypt® certificate or a user certificate for the domain you are connecting.

      Note

      Make sure to timely update your certificates. Learn more about updating Let's Encrypt® certificates and custom certificates.

    2. Wait until the certificate status switches to Issued.

  4. Go back to the folder page.

  5. In the list of services, select API Gateway and:

    1. Select the API gateway.
    2. In the window that opens, go to Domains.
    3. Click Attach, select a certificate, and enter a domain name (FQDN).
  6. If you skipped step 1 and did not add a CNAME record, create an ANAME record in Yandex Cloud DNS:

    1. Click Create record in the domain row.
    2. If you do not have a DNS zone with the same name as the domain, create one. To do this, click Create zone.
    3. Select a different value in the TTL (in seconds) field, if required.
    4. Click Create.

To add a domain to an API gateway, use the addDomain REST API method for the ApiGateway resource or the ApiGatewayService/AddDomain gRPC API call.

Was the article helpful?

Previous
Updating API gateways and their specifications
Next
Specifying a cloud network
Yandex project
© 2025 Yandex.Cloud LLC