Creating a DHCP Options Set

Create a set of Dynamic Host Configuration Protocol (DHCP) options to automatically provide configuration information when instances start.

    1. On the Virtual cloud networks list page, select the VCN that contains the DHCP options you want to work with. If you need help finding the list page or the VCN, see Listing VCNs.
    2. On the details page, select IP administration and find the DHCP Options section.
      All DHCP options for the VCN are displayed in a table.
    3. Select Create DHCP options.
      The Create DHCP Options panel opens.
    4. Enter the following information:
      • Name: Enter the name of the DHCP options set.
      • Create in compartment: Select the compartment for the DHCP options set.
      • DNS type: Select one of the following DNS resolver types:
        • Internet and VCN resolver: Instances can resolve host names within the VCN and on the internet. No internet gateway is required.
        • Custom Resolver: Specify one to three DNS server IP addresses in the DNS server address field. At least one is required. Select + Another DNS server to add up to three servers.
      • Access to internet and VCN resolver: (Custom resolver only.) Enable this option to allow the custom resolver access to the internet and the VCN resolver.
      • DNS search domain type: Select one of the following DNS search domain types:
        • Subnet search domain: Sends the subnet domain name to DHCP clients based on their subnet membership. For example: subnet1.vcn1.oraclevcn.com.
        • VCN search domain: Sends the VCN domain name to DHCP clients based on their VCN membership. For example: vcn1.oraclevcn.com.
        • Custom search domain: Sends the provided fully qualified domain name (FQDN) to DHCP clients. Use this option with more advanced DNS scenarios.
      • Search domain: Enter the search domain if you want instances in the subnet to append a particular search domain when resolving DNS queries. If the Search Domain option is already set to the VCN domain name and you're not sure why, see the details in Overview of DHCP Options.
      • Tags: Add defined or free-form tags for this resource as described in Adding Tags at Resource Creation. Tags can also be applied later.
  • Use the oci network dhcp-options create command and required parameters to create a DHCP options set for a VCN:

    oci network dhcp-options create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --options <options> [OPTIONS]

    <options> is a set of DHCP options whose value must be valid JSON. You can provide the value as a string on the command line or in a file by using the file://path/to/file syntax.

    Use the --generate-param-json-input option to generate an example of the required JSON. Store this example in a file, update it as needed, and then pass it by using the file:// syntax. For example:

    '[{"type": "DomainNameServer", "customDnsServers": ["202.44.61.9"], "serverType": "CustomDnsServer"}]'

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateDhcpOptions operation to create a DHCP options set for a VCN.