Work with DHCP option sets - Amazon Virtual Private Cloud

Work with DHCP option sets

Use the following procedures to view and work with DHCP option sets. For more information about how DHCP option sets work, see DHCP option set concepts.

View your DHCP option sets

You can view your DHCP option sets as follows. For a default DHCP option set, the only settings with values are Domain name and Domain name servers.

To view your DHCP option sets using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose DHCP option sets.

  3. Choose the ID of a DHCP option set to open its details page.

To view your DHCP option sets using the command line

For more information about these command line interfaces, see Working with Amazon VPC.

Create a DHCP option set

A custom DHCP option set enables you to customize your VPC with your own DNS server, domain name, and more. You can create as many additional DHCP option sets as you want. However, you can only associate a VPC with one DHCP option set at a time.

Note

After you create a DHCP option set, you can't modify it. To update the DHCP options for your VPC, you must create a new DHCP option set and then associate it with your VPC.

To create a DHCP options set using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose DHCP option sets.

  3. Choose Create DHCP options set.

  4. For Tag settings, optionally enter a name for the DHCP option set. If you enter a value, it automatically creates a Name tag for the DHCP option set.

  5. For DHCP options, provide the configuration settings that you need.

    • Domain name (optional): Enter the domain name that a client should use when resolving hostnames via the Domain Name System. If you are not using AmazonProvidedDNS, your custom domain name servers must resolve the hostname as appropriate. If you use an Amazon RouteĀ 53 private hosted zone, you can use AmazonProvidedDNS. For more information, see DNS attributes for your VPC.

      Some Linux operating systems accept multiple domain names separated by spaces. However, other Linux operating systems and Windows treat the value as a single domain, which results in unexpected behavior. If your DHCP option set is associated with a VPC that contains instances that are not all running the same operating systems, specify only one domain name.

    • Domain name servers (optional): Enter the DNS servers that will be used to resolve the IP address of a host from the host's name.

      You can enter either AmazonProvidedDNS or custom domain name servers. Using both might cause unexpected behavior. You can enter the IP addresses of up to four IPv4 domain name servers (or up to three IPv4 domain name servers and AmazonProvidedDNS) and four IPv6 domain name servers separated by commas. Although you can specify up to eight domain name servers, some operating systems might impose lower limits. For more information about AmazonProvidedDNS and the Amazon DNS server, see Amazon DNS server.

      Important

      If your VPC has an internet gateway, be sure to specify your own DNS server or an Amazon DNS server (AmazonProvidedDNS) for the Domain name servers value. Otherwise, the instances in the VPC won't have access to DNS, which disable internet access.

    • NTP servers (optional): Enter the IP addresses of up to eight Network Time Protocol (NTP) servers (four IPv4 addresses and four IPv6 addresses).

      NTP servers provide the time to your network. You can specify the Amazon Time Sync Service at IPv4 address 169.254.169.123 or IPv6 address fd00:ec2::123. Instances communicate with the Amazon Time Sync Service by default. Note that the IPv6 address is only accessible on EC2 instances built on the Nitro System.

      For more information about the NTP servers option, see RFC 2132. For more information about the Amazon Time Sync Service, see Set the time for your instance in the Amazon EC2 User Guide for Linux Instances.

    • NetBIOS name servers (optional): Enter the IP addresses of up to four NetBIOS name servers.

      For EC2 instances running a Windows OS, the NetBIOS computer name is a friendly name assigned to the instance to identify it on the network. The NetBIOS name server maintains a list of mappings between NetBIOS computer names and network addresses for networks that use NetBIOS as their naming service.

    • NetBIOS node type (optional): Enter 1, 2, 4, or 8. We recommend that you specify 2 (point-to-point or P-node). Broadcast and multicast are not currently supported. For more information about these node types, see section 8.7 of RFC 2132 and section 10 of RFC1001.

      For EC2 instances running a Windows OS, this is the method that the instances use to resolve NetBIOS names to IP addresses. In the default options set, there is no value for NetBIOS node type.

  6. Add Tags.

  7. Choose Create DHCP options set. Note the name or ID of the new DHCP option set.

  8. To configure a VPC to use the new option set, see Change the option set associated with a VPC.

To create a DHCP option set for your VPC using the command line

For more information about these command line interfaces, see Working with Amazon VPC.

Change the option set associated with a VPC

After you create a DHCP option set, you can associate it with one or more VPCs. You can associate only one DHCP option set with a VPC at a time. If you do not associate a DHCP option set with a VPC, this disables domain name resolution in the VPC.

When you associate a new set of DHCP options with a VPC, any existing instances and all new instances that you launch in that VPC use the new options. You don't need to restart or relaunch your instances. Instances automatically pick up the changes within a few hours, depending on how frequently they renew their DHCP leases. If you prefer, you can explicitly renew the lease using the operating system on the instance.

To change the DHCP option set associated with a VPC using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Your VPCs.

  3. Select the check box for the VPC, and then choose Actions, Edit VPC settings.

  4. For DHCP options set, choose a new DHCP option set. Alternatively, choose No DHCP option set to disable domain name resolution for the VPC.

  5. Choose Save.

To change the DHCP option set associated with a VPC using the command line

For more information about these command line interfaces, see Working with Amazon VPC.

Delete a DHCP option set

When you no longer need a DHCP option set, use the following procedure to delete it. You can't delete a DHCP option set if it's in use. For each VPC associated with the DHCP option set to delete, you must associate a different DHCP option set with the VPC or configure the VPC to use no DHCP option set. For more information, see Change the option set associated with a VPC.

To delete a DHCP option set using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose DHCP option sets.

  3. Select the radio button for the DHCP option set, and then choose Actions, Delete DHCP option set.

  4. When prompted for confirmation, enter delete, and then choose Delete DHCP option set.

To delete a DHCP option set using the command line

For more information about these command line interfaces, see Working with Amazon VPC.