copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2024-10-25 |
dns-svcs |
{{site.data.keyword.attribute-definition-list}}
{: #ui-create-cr}
You can add a custom resolver in {{site.data.keyword.dns_full}} by using the UI, CLI, or API. {: shortdesc}
{: #create-cr-ui} {: ui}
To add a custom resolver in {{site.data.keyword.dns_short}}, follow these steps:
Each VPC can have only one custom resolver. {: note}
-
Navigate to Custom resolvers in the {{site.data.keyword.dns_short}} navigation menu.
-
Click Create custom resolver.
-
Enter a name and description for your custom resolver.
-
Select a region from the list menu.
-
Select a VPC from the list menu.
-
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. {: important}
-
Click Add+ if you want to add another subnet.
-
Click Create.
The custom resolver details view appears, where you can manage custom resolver settings.
{: #cr-add-no-ha}
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.
{: caption="Delete the second subnet to remove high availability function" caption-side="bottom"}
{: #cli-create-cr} {: 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.
{: #api-create-cr} {: api}
To add a custom resolver using the API, follow these steps:
- Set up your API environment with the correct variables.
- 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.
- 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
}
]
}
{: codeblock}
{: #next-steps-create-cr}