| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
This topic describes DHCP options sets and how to specify the DHCP options for your VPC.
Topics
The Dynamic Host Configuration Protocol (DHCP) provides a standard for
passing configuration information to hosts on a TCP/IP network. The
options field of a DHCP message contains the
configuration parameters. Some of those parameters are the domain name,
domain name server, and the netbios-node-type.
DHCP options sets are associated with your AWS account so that you can use them across all of your virtual private clouds (VPC).
The Amazon EC2 instances you launch into a nondefault VPC are private; they're not assigned a public IP address. By default, all instances in a nondefault VPC receive an unresolvable host name that AWS assigns (for example, ip-10-0-0-202). You can assign your own domain name to your instances, and use up to four of your own DNS servers. To do that, you must specify a special set of DHCP options to use with the VPC. This set can contain other commonly used DHCP options (see the following table for the full list of supported options). For more information about the options, see RFC 2132.
| DHCP Option Name | Description |
|---|---|
|
domain-name |
A domain name of your choice (for example, example.com). |
|
domain-name-servers |
The IP address of a domain name server. You can specify up to four addresses. |
|
ntp-servers |
The IP address of a Network Time Protocol (NTP) server. You can specify up to four addresses. |
|
netbios-name-servers |
The IP address of a NetBIOS name server. You can specify up to four addresses. |
|
netbios-node-type |
The NetBIOS node type (1, 2, 4, or 8). For more information about the values, see RFC 2132. We recommend you only use 2 at this time (broadcast and multicast are currently not supported). |
When you create a VPC, we automatically create a set of DHCP options and associate them
with the VPC. This set includes only a single option:
domain-name-servers=AmazonProvidedDNS. This is an Amazon DNS server, and this option
enables DNS for instances that need to communicate over the VPC's Internet gateway. The string
AmazonProvidedDNS maps to a DNS server running on a reserved IP address at the base
of the VPC network range "plus two". For example, the DNS Server on a 10.0.0.0/16 network is
located at 10.0.0.2.
Note
You can also use the Amazon DNS server IP address 169.254.169.253, though some servers don't allow its use. Windows Server 2008, for example, disallows the use of a DNS server located in the 169.254.x.x network range.
After you create a set of DHCP options, you can't modify them. If you want your VPC to use a different set of DHCP options, you must create a new set and associate them with your VPC. You can also set up your VPC to use no DHCP options at all.
You can have multiple sets of DHCP options, but you can associate only one set of DHCP options with a VPC at a time. If you delete a VPC, the DHCP options set associated with the VPC are also deleted.
After you associate a new set of DHCP options with a VPC, any existing instances and all new instances that you launch in the VPC use these options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. If you want, you can explicitly renew the lease using the operating system on the instance.
This section shows you how to work with DHCP options sets.
Topics
You can create as many additional DHCP options sets as you want. However, you can only associate a VPC with one set of DHCP options at a time. After you create a set of DHCP options, you must configure your VPC to use it. For more information, see Changing the Set of DHCP Options a VPC Uses.
To create a DHCP options set
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
Click DHCP Options Sets in the navigation pane, and then click the Create DHCP Options Set button.
In the Create DHCP Options Set dialog box, enter values for the options that you want to use, and then click Yes, Create.
Important
If your VPC has an Internet gateway, make sure to specify your own DNS server or Amazon's DNS server (AmazonProvidedDNS) for the domain-name-servers value. Otherwise, the instances that need to communicate with the Internet won't have access to DNS.

The new set of DHCP options appears in your list of DHCP options. The following image shows an example of the list, with both the set of DHCP options you just created and the set that automatically came with your VPC (where the only option is domain-name-servers=AmazonProvidedDNS).

Make a note of the ID of the new set of DHCP options (dopt-xxxxxxxx). You will need it to associate the new set of options with your VPC.
Although you've created a set of DHCP options, you must associate it with your VPC for the options to take effect. You can create multiple sets of DHCP options, but you can associate only one set of DHCP options with your VPC at a time.
You can change which set of DHCP options your VPC uses. If you want the VPC to use no DHCP options, see Changing a VPC to use No DHCP Options.
Note
The following procedure assumes that you've already created the DHCP options set you want to change to. If you haven't, create the options set now. For more information, see Creating a DHCP Options Set.
To change the DHCP options set associated with a VPC
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
Click Your VPCs in the navigation pane.
Select the VPC and click the Change DHCP Options Set button.
In the Change DHCP Options Set dialog box, select a set of options from the drop-down list, and then click Yes, Change.

After you associate a new set of DHCP options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. If you want, you can explicitly renew the lease using the operating system on the instance.
You can set up your VPC to use no set of DHCP options.
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
Click Your VPCs in the navigation pane.
Select the VPC and click the Change DHCP Options Set button.
In the Change DHCP Options Set dialog box, select none from the drop-down list, and then click Yes, Change.

You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. If you want, you can explicitly renew the lease using the operating system on the instance.
When you no longer need a DHCP options set, use the following procedure to delete it. The VPC must not be using the set of options.
To delete a DHCP options set
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
Click DHCP Options Set in the navigation pane.
Select the set of DHCP options to delete, and then click Delete.

In the Delete DHCP Options Set dialog box, click Yes, Delete.
The following table summarizes the available DHCP options set commands and corresponding API actions.
| Description | Command | API Action |
|---|---|---|
|
Creates a set of DHCP options for your VPC. | ||
|
Associates a set of DHCP options with the specified VPC, or changes the VPC to use no DHCP options. | ||
|
Describes one or more of your sets of DHCP options. | ||
|
Deletes a set of DHCP options. |