You can configure a Domain Name System (DNS) server for your services to resolve internal domain names efficiently and securely. Adding custom DNS servers to the gateway's service configuration centralizes internal name resolution and eliminates dependency on external DNS, preventing service unavailability caused by external DNS failures or network performance fluctuation.
Use cases
| Scenario | Description |
|---|---|
| Custom internal DNS | Route queries for domain names that the default VPC DNS cannot resolve to your own DNS servers, such as private service registries or on-premises endpoints. |
| VPC-internal service routing | Resolve internal domain names to backend addresses so the cloud-native gateway routes requests accurately within the VPC. |
| Hybrid cloud environments | Manage DNS resolution for both cloud-hosted and on-premises services in a single configuration, keeping routing consistent across environments. |
Configure DNS servers for a service
DNS server settings are part of each service's configuration. You configure them when adding a new service or editing an existing one.
Currently, only DNS domain names are supported as service sources.
Before you begin
Make sure you have:
An MSE cloud-native gateway
(Optional) Alibaba Cloud DNS activated, if you want automatic internal DNS server assignment in your VPC
Open the service configuration
Log on to the MSE console and select a region in the top navigation bar.
In the left-side navigation pane, choose Cloud-native Gateway > Gateways.
On the Gateways page, click the gateway ID.
In the left-side navigation pane, click Routes, then click the Services tab.
Open the service configuration:
To add a new service, click Add Service.
To update an existing service, click Edit in the Actions column of the target service.
Add DNS servers
Click More Settings to expand the advanced configuration options.
Add DNS server addresses using one of the following methods: Automatic assignment When you activate Alibaba Cloud DNS, Alibaba Cloud assigns internal DNS server addresses to your VPC. Clicking the auto-assign button retrieves these addresses and populates the DNS server list. Manual entry Click Add and enter a DNS server address. Repeat this step to add more servers.
Method Steps When to use Automatic assignment Click Click to automatically specify DNS server IP addresses. The system populates the DNS server list with the internal DNS addresses that Alibaba Cloud DNS assigned to your VPC. You have activated Alibaba Cloud DNS and want to use VPC-assigned DNS addresses. Manual entry Click Add and enter a DNS server address. Repeat to add more servers (up to five). You manage your own DNS servers or need to specify addresses that differ from the VPC defaults. 

Save the service configuration.
Limits
| Item | Limit |
|---|---|
| Maximum DNS servers | 5 |
| Supported service source types | DNS domain names only |