You can use Dynamic Host Configuration Protocol (DHCP) options sets to configure DNS server IP addresses and domain names for Elastic Compute Services (ECS) instances in virtual private clouds (VPCs). Before you can use a DHCP options set, you must create one and specify the DNS server IP addresses and domain names that your business requires. Then, you can associate the DHCP options set with a VPC. After the DHCP options set is associated with the VPC, newly created ECS instances in the VPC use the configurations of the DHCP options set. After the DHCP options set is synchronized with existing ECS instances, existing ECS instances also use the configurations of the DHCP options set.
Limits
You can associate a DHCP options set with a VPC. After you associate a DHCP options set with a VPC, newly created ECS instances in the VPC use the configurations of the DHCP options set. Existing ECS instances also use the configurations of the DHCP options set after you restart the ECS instances, restart the DHCP client, or restart network services. For more information, see Overview of DHCP options sets.
A DHCP options set can be associated with only VPCs deployed in the region where the DHCP options set is created.
A DHCP options set can be associated with multiple VPCs. However, a VPC can be associated with only one DHCP options set.
By default, a DHCP options set can be associated with up to 10 VPCs. You cannot increase the quota.
Create a DHCP options set
Log on to the VPC console.
In the left-side navigation pane, click DHCP Options Sets.
In the top navigation bar, select the region where you want to create the DHCP options set.
For more information about the regions that support DHCP options sets, see Features and supported regions.
- On the DHCP Options Sets page, click Create DHCP Options Set.
On the Create DHCP Options Set page, set the following parameters. Keep parameters not covered in the table as default values or modify them as needed.
Parameter
Description
Configure DHCP Options Set
Domain Name
Enter a root domain name.
After you associate the DHCP options set with a VPC, the domain name is synchronized to the ECS instances deployed in the VPC.
example.com is used in this example.
DNS Server IP Address
Enter DNS server IP addresses.
The IP addresses of Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138, are used by default. This ensures that you can access basic services deployed on Alibaba Cloud. You can click Customize DNS server IP addresses to specify custom DNS server IP addresses to meet your requirements. You can specify up to four DNS server IP addresses.
ImportantBefore you specify custom DNS server IP addresses, take note of the following limits:
The system automatically specifies the IP addresses of Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138. If you delete these IP addresses, you may not be able to access the basic services deployed on Alibaba Cloud. Proceed with caution.
You must add rules to the security group and network access control lists (ACLs) to enable access to the specified custom DNS servers. Otherwise, the services deployed on your ECS instances cannot be resolved. If network ACLs do not exist, add rules only to the security group. For more information, see Add security group rules and Add network ACL rules.
192.168.1.1 is used in this example.
Associate a DHCP options set with a VPC
Log on to the VPC console.
You can associate a DHCP options set with a VPC by using one of the following methods:
Associate a DHCP options set with a VPC on the VPC page.
In the top navigation bar, select the region of the VPC.
On the VPC page, click the ID of the VPC.
In the VPC Details section, click Associate next to DHCP Options Set.
In the Associate DHCP Options Set dialog box, select a DHCP options set and click OK.
Associate a DHCP options set with a VPC on the DHCP Options Sets page.
In the top navigation bar, select the region of the DHCP options set.
In the left-side navigation pane, click DHCP Options Sets.
On the DHCP Options Sets page, use one of the following methods to associate the DHCP options set with a VPC.
Find the DHCP options set and click Associate with VPC in the Actions column.
Click the ID of the DHCP options set. In the Associated VPCs section, click Associate.
In the Associate with VPC dialog box, select a VPC and click OK.
More operations
Log on to the VPC console.
You can perform the following operations to modify a DHCP options set, replace an associated DHCP options set, or delete a DHCP options set.
Operation
Procedure
Modify a DHCP options set
After you create a DHCP options set, you can modify it.
In the left-side navigation pane, click DHCP Options Sets.
On the DHCP Options Sets page, find the DHCP options set that you want to modify and click Edit in the Actions column.
On the Modify DHCP Options Set page, modify the name, description, domain name, or DNS server IP address, and then click OK.
Replace the DHCP options set associated with a VPC
After you associate a DHCP options set with a VPC, you can replace the DHCP options set based on your business requirements.
In the top navigation bar, select the region where the VPC is deployed.
On the VPCs page, find the VPC that you want to manage and click its ID.
In the VPC Details section, click Modify Association next to DHCP Options Set.
In the Associate DHCP Options Set dialog box, select a DHCP options set and click OK.
Disassociate a DHCP options set from a VPC
You can use one of the following methods to disassociate a DHCP options set from a VPC. After the DHCP options set is disassociated, ECS instances in the VPC cannot use the configurations in the DHCP options set through the DHCP protocol.
Disassociate a DHCP options set from a VPC on the VPC page.
In the top navigation bar, select the region of the VPC.
On the VPC page, click the ID of the VPC.
In the VPC Details section, click Delete Association next to DHCP Options Set.
In the message that appears, click OK.
Disassociate a DHCP options set from a VPC on the DHCP Options Sets page.
In the top navigation bar, select the region of the DHCP options set.
In the left-side navigation pane, click DHCP Options Sets.
On the DHCP Options Sets page, click the ID of the DHCP options set.
In the Associated VPCs section, find the VPC that you want to disassociate and click Disassociate in the Actions column.
In the message that appears, click OK.
Delete a DHCP options set
Make sure that the DHCP options set to be deleted is not associated with a VPC.
In the left-side navigation pane, click DHCP Options Sets.
On the DHCP Options Sets page, find the DHCP options set that you want to delete and click Delete in the Actions column.
In the message that appears, click OK.
References
For more information about the features, limits, and policies of DHCP options sets, see Overview of DHCP options sets.
For more information about DNS, see What is Private DNS?