CreateDhcpOptions - Amazon Elastic Compute Cloud


Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132.

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas. To have your instance receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers to a custom DNS server.

  • domain-name - If you're using AmazonProvidedDNS in us-east-1, specify ec2.internal. If you're using AmazonProvidedDNS in another Region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). Otherwise, specify a domain name (for example, This value is used to complete unqualified DNS hostnames. Important: Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.

  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.

  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.

  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132.

Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information, see DHCP options sets in the Amazon VPC User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.


A DHCP configuration option.

Type: Array of NewDhcpConfiguration objects

Required: Yes


Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No


The tags to assign to the DHCP option.

Type: Array of TagSpecification objects

Required: No

Response Elements

The following elements are returned by the service.


A set of DHCP options.

Type: DhcpOptions object


The ID of the request.

Type: String


For information about the errors that are common to all actions, see Common client error codes.



This example creates a set of DHCP options with a domain name and two DNS servers ( and The DNS servers' IP addresses are specified in a single parameter, separated by commas, to preserve the order in which they are specified.

Sample Request &DhcpConfiguration.1.Key=domain-name & &DhcpConfiguration.2.Key=domain-name-servers &DhcpConfiguration.2.Value.1=, &AUTHPARAMS

Sample Response

<CreateDhcpOptionsResponse xmlns=""> <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId> <dhcpOptions> <dhcpOptionsId>dopt-096c1234cade2dabc</dhcpOptionsId> <dhcpConfigurationSet> <item> <key>domain-name</key> <valueSet> <item> <value></value> </item> </valueSet> </item> <item> <key>domain-name-servers</key> <valueSet> <item> <value></value> </item> <item> <value></value> </item> </valueSet> </item> </dhcpConfigurationSet> <tagSet/> </dhcpOptions> </CreateDhcpOptionsResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: