Hostname Management

Learn to use hostnames with a load balancer for one or more listeners.

This topic describes how to manage your load balancer's hostnames for use with one or more listeners.

Creating Hostnames

Create a hostname for a Load Balancer resource.

Use one of the following methods to create a hostname for a selected load balancer.

To create a hostname using the Console

Use the OCI Console to create a hostname for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer for which you want to create a hostname.

    The Load Balancer Details dialog box appears.

  6. Click Hostnames under Resources.

    The Hostnames list appears. All hostnames are listed in tabular form.

  7. Click Create Hostname.

    The Create Hostname dialog box appears.

  8. Enter the following:

    • Name: Required. Specify a friendly name for the hostname. The name must be unique, and cannot be changed.

    • Hostname: Required. Specify the virtual hostname. See Hostname Management for more information.

  9. Click Create. The Work Request Submitted dialog box opens.

  10. (optional) Click View All Work Requests to open the Work Requests page and view the status of the work request.

  11. Click Close.

To create a hostname using the CLI

Use the command line interface (CLI) to create a hostname for a Load Balancer resource.

Enter the following command:

oci lb hostname create --hostname hostname --name name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb hostname create --help

See oci lb hostname create for a complete description of the command.

To create a hostname using the API

Use the API to create a hostname for a Load Balancer resource.

Run the CreateHostname method to create a listener for a load balancer. See CreateHostname for a complete description.

Listing Hostnames

List the hostnames for a Load Balancer resource.

Use one of the following methods to display a list of hostnames for a selected load balancer.

To list the hostnames using the Console

Use the OCI Console to list the hostnames for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer for which you want to create a hostname.

    The Load Balancer Details dialog box appears.

  6. Click Hostnames under Resources.

    The Hostname list appears. All hostnames are listed in tabular form.

To list the hostnames using the CLI

Use the command line interface (CLI) to list the hostnames for a Load Balancer resource.

Enter the following command:

oci lb hostname list --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb hostname list --help

See oci lb hostname list for a complete description of the command.

To list the hostnames using the API

Use the API to list the hostnames for a Load Balancer resource.

Run the ListHostnames method to display a list of hostnames for a load balancer. See ListHostnames for a complete description.

Getting Hostname Details

Get the details of a hostname for a Load Balancer resource.

Use one of the following methods to display the details of a hostname for a selected load balancer.

To get the details of a hostname using the Console

Use the OCI Console to get the details of a hostname for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer for which you want to create a hostname.

    The Load Balancer Details dialog box appears.

  6. Click Hostnames under Resources.

    The Hostname list appears. All hostnames are listed in tabular form.

    The following details are displayed for each hostname:

    • Name

    • Hostname

To get the details of a hostname using the CLI

Use the command line interface (CLI) to get the details of a hostname for a Load Balancer resource.

Enter the following command:

oci lb hostname get --name name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb hostname get --help

See oci lb hostname get for a complete description of the command.

To get the details of a hostname using the API

Use the API to get the details of a hostname for a Load Balancer resource.

Run the GetHostname method to get the details of a hostname for a load balancer. See GetHostname for a complete description.

Editing Hostnames

Update a hostname for a Load Balancer resource.

Use one of the following methods to edit and update the settings of a hostname for a selected load balancer.

To edit a hostname using the Console

Use the OCI Console to update a hostname for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer for which you want to create a hostname.

    The Load Balancer Details dialog box appears.

  6. Click Hostnames under Resources.

    The Hostnames list appears. All hostnames are listed in tabular form.

    The following details are displayed for each hostname:

    • Name

    • Hostname

  7. For the hostname you want to edit, click the Actions menu, and then click Edit.
  8. In the Edit Hostname dialog box, enter your updates to the Hostname field.

    You cannot edit the Name field of an existing virtual hostname.

  9. Click Update. The Work Request Submitted dialog box opens.
  10. To close the dialog box, click Close. To open the Work Requests page and view the status of the work request, click View All Work Requests.
To edit a hostname using the CLI

Use the command line interface (CLI) to update a hostname for a Load Balancer resource.

Enter the following command:

oci lb hostname update --name name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb hostname update --help

See oci lb hostname get for a complete description of the command.

To edit a hostname using the API

Use the API to update a hostname for a Load Balancer resource.

Run the UpdateHostname method to edit a hostname for a load balancer. See UpdateHostname for a complete description.

Deleting Hostnames

Delete a hostname from a Load Balancer resource.

Use one of the following methods to delete a hostname from a selected load balancer.

To delete a hostname using the Console

Use the OCI Console to delete a hostname from a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer for whose hostname you want to delete.

    The Load Balancer Details dialog box appears.

  6. Click Hostnames under Resources.

    The Hostnames list appears. All hostnames are listed in tabular form.

  7. Click the Actions icon (Actions icon) associated with the hostname you want to delete and click Delete.

  8. Confirm the deletion when prompted.

To delete a hostname using the CLI

Use the command line interface (CLI) to delete a hostname from a Load Balancer resource.

Enter the following command:

oci lb hostname delete --name name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb hostname delete --help

See oci lb hostname delete for a complete description of the command.

To delete a hostname using the API

Use the API to delete a hostname from a Load Balancer resource.

Run the DeleteHostname method to get the details of a hostname for a load balancer. See DeleteHostname for a complete description.