Configuring a Private Zone¶
Scenario¶
If you have deployed ECSs and other cloud services within VPCs, you can configure private domain names for the ECSs so that they can communicate with each other or access the cloud services over a private network.
You can create any private zones that are unique within VPCs. You do not need to register the domain names.
Prerequisites¶
You have created an ECS and obtained its VPC name and private IP address.
Process Flow¶
Figure 1 shows the process of configuring a private zone for routing traffic within VPCs.
Note
To ensure that the private domain name can be resolved in the associated VPC, verify that the DNS server addresses for the VPC subnet are those provided by the DNS service. If the DNS server addresses are not those provided by the DNS service, change them.
You can also change the DNS server addresses of the VPC subnet where the domain name is used.
Creating a Private Zone¶
Create a private zone.
Create a private zone to allow access to your ECS using a private domain name example.com.
Log in to the management console.
In the service list, choose Network > Domain Name Service.
The DNS console is displayed.
In the navigation pane on the left, choose Private Zones.
The Private Zones page is displayed.
Click in the upper left corner and select the desired region and project.
Click Create Private Zone.
Set Domain Name to example.com and select the VPC where the ECS resides.
Set other parameters by referring to Creating a Private Zone.
Click OK.
Switch back to the Private Zones page.
You can view the created private zone in the private zone list.
Note
Click the domain name to view SOA and NS record sets automatically generated for the zone.
The start of authority (SOA) record includes administrative information about your zone, as defined by the Domain Name System (DNS).
The NS record set defines the authoritative DNS servers for the domain name.
Add an A record set to the domain name.
To access the ECS using example.com, add an A record set.
On the Private Zones page, click the domain name of the private zone you created.
The Record Sets page is displayed.
Click Add Record Set.
Configure the parameters as follows:
Name: Leave this parameter blank. The DNS service automatically considers example.com as the name, and requests are routed to example.com.
Type: Retain the default setting A - Map domains to IPv4 addresses.
Value: Enter the private IP address of the ECS.
Configure other parameters by referring to Adding an A Record Set.
Click OK.
Switch back to the Record Sets tab.
The added record set is in the Normal state.
Change the DNS server addresses of the VPC subnet.
To ensure that the private domain name can be resolved in the associated VPC, verify that the DNS server addresses for the VPC subnet are those provided by the DNS service. If the DNS server addresses are not those provided by the DNS service, change them.
Query the private DNS server addresses provided by the DNS service.
Log in to the management console.
In the service list, choose Network > Domain Name Service.
The DNS console is displayed.
In the navigation pane on the left, choose Private Zones.
The Private Zones page is displayed.
Click in the upper left corner and select the desired region and project.
In the private zone list, click the domain name of the zone and view the DNS server addresses.
Change the DNS server addresses.
Go to the private zone list.
Click the VPC name under Associated VPC.
On the VPC console, change the DNS server addresses for the VPC subnet.
For details, see Modifying a Subnet.