AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the CreateDhcpOptions operation. Creates a custom set of DHCP options. After you create a DHCP option set, you associate it with a VPC. After you associate a DHCP option set with a VPC, all existing and newly launched instances in the VPC use this set of DHCP options.
The following are the individual DHCP options you can specify. For more information, see DHCP option sets in the Amazon VPC User Guide.
domain-name
- If you're using AmazonProvidedDNS in us-east-1
, specify
ec2.internal
. If you're using AmazonProvidedDNS in any other Region, specify
region.compute.internal
. Otherwise, specify a custom domain name. This value
is used to complete unqualified DNS hostnames.
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 option set is associated with a VPC that has instances running operating systems that treat the value as a single domain, specify only one domain name.
domain-name-servers
- The IP addresses of up to four DNS servers, or AmazonProvidedDNS.
To specify multiple domain name servers in a single parameter, separate the IP addresses
using commas. To have your instances receive custom DNS hostnames as specified in
domain-name
, you must specify a custom DNS server.
ntp-servers
- The IP addresses of up to eight Network Time Protocol (NTP)
servers (four IPv4 addresses and four IPv6 addresses).
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 supported. For more information about
NetBIOS node types, see RFC 2132.
ipv6-address-preferred-lease-time
- A value (in seconds, minutes, hours, or
years) for how frequently a running instance with an IPv6 assigned to it goes through
DHCPv6 lease renewal. Acceptable values are between 140 and 2147483647 seconds (approximately
68 years). If no value is entered, the default lease time is 140 seconds. If you use
long-term addressing for EC2 instances, you can increase the lease time and avoid
frequent lease renewal requests. Lease renewal typically occurs when half of the lease
time has elapsed.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class CreateDhcpOptionsRequest : AmazonEC2Request IAmazonWebServiceRequest
The CreateDhcpOptionsRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
CreateDhcpOptionsRequest() |
Empty constructor used to set properties independently even when a simple constructor is available |
![]() |
CreateDhcpOptionsRequest(List<DhcpConfiguration>) |
Instantiates CreateDhcpOptionsRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
![]() |
DhcpConfigurations | System.Collections.Generic.List<Amazon.EC2.Model.DhcpConfiguration> |
Gets and sets the property DhcpConfigurations. A DHCP configuration option. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true. |
![]() |
DryRun | System.Nullable<System.Boolean> |
Gets and sets the property DryRun.
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 |
![]() |
TagSpecifications | System.Collections.Generic.List<Amazon.EC2.Model.TagSpecification> |
Gets and sets the property TagSpecifications. The tags to assign to the DHCP option. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true. |
This example creates a DHCP options set.
var client = new AmazonEC2Client(); var response = client.CreateDhcpOptions(new CreateDhcpOptionsRequest { DhcpConfigurations = new List<DhcpConfiguration> { new DhcpConfiguration { Key = "domain-name-servers", Values = new List<string> { "10.2.5.1", "10.2.5.2" } } } }); DhcpOptions dhcpOptions = response.DhcpOptions;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer