IBM Cloud Docs
Configuring a custom resolver

Configuring a custom resolver

You can add a custom resolver in IBM Cloud® DNS Services by using the UI, CLI, or API.

Creating a custom resolver using the UI

To add a custom resolver in DNS Services, follow these steps:

Each VPC can have only one custom resolver.

  1. Navigate to Custom resolvers in the DNS Services navigation menu.

  2. Click Create custom resolver.

  3. Enter a name and description for your custom resolver.

  4. Select a region from the list menu.

  5. Select a VPC from the list menu.

  6. Select a subnet from the list menu.

    To achieve high availability, you must provide a minimum of two subnets. You can configure a maximum of three locations within the same subnet, or in different subnets.

  7. Click Add+ if you want to add another subnet.

  8. Click Create.

    The custom resolver details view appears, where you can manage custom resolver settings.

Creating a custom resolver without high availability

If you want to create a custom resolver without high availability, you must manually delete the second subnet field by clicking the trashcan icon next to the second subnet.

Delete second subnet
Figure 1. Delete the second subnet to remove high availability function

Creating a custom resolver using the CLI

To create a custom resolver using the CLI, run the following command:

ibmcloud dns custom-resolver-create --name NAME --location LOCATION1 --location LOCATION2 [-description DESCRIPTION] [-i, --instance INSTANCE] [--output FORMAT]

Where:

  • -n, --name is the name of the custom resolver.
  • -d, --description is the descriptive text of the custom resolver.
  • --location is the location where the custom resolver is running. The location subnet CRN is required. For example: --location subnet1,enable --location subnet2,disable
  • -i, --instance is the instance name or ID. If this is not set, the context instance specified by dns instance-target INSTANCE is used instead.
  • --output specifies output format. Currently, JSON is the only supported format.

To create a custom resolver without high availability, run the command with [-f, --force]:

ibmcloud dns custom-resolver-create --name NAME [--location LOCATION1] [--location LOCATION2] [-description DESCRIPTION] [-f, --force] [-i, --instance INSTANCE] [--output FORMAT]

Where:

  • -f, --force allows for creating custom resolver with fewer than 2 locations.

Create a custom resolver using the API

To add a custom resolver using the API, follow these steps:

  1. Set up your API environment with the correct variables.
  2. Store the following values in variables to be used in the API command:
    • instance_id, which is the unique identifier of a service instance.
    • X-Correlation-ID, which is a string that uniquely identifies a request.
  3. When all variables are initiated, add your custom resolver:
{
  "name": "my-resolver",
  "description": "custom resolver",
  "locations": [
    {
      "subnet_crn": "crn:v1:bluemix:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-b49ef064-0f89-4fb1-8212-135b12568f04",
      "enabled": false
    }
  ]
}

Next steps