Help Center/ Elastic Load Balance/ API Reference/ APIs (V3)/ Load Balancer/ Configuring User-defined Domain Name Resolution for a Load Balancer
Updated on 2026-01-09 GMT+08:00

Configuring User-defined Domain Name Resolution for a Load Balancer

Function

This API is used to configure user-defined domain name resolution for a load balancer.

Calling Method

For details, see Calling APIs.

URI

POST /v3/{project_id}/elb/loadbalancers/{loadbalancer_id}/dns/user-defined-config

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Constraints: N/A

Range: The value can contain a maximum of 32 characters, including digits and lowercase letters.

Default value: N/A

loadbalancer_id

Yes

String

Specifies the load balancer ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: Specifies the token used for IAM authentication.

Constraints: N/A

Range: N/A

Default value: N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

loadbalancer

Yes

UserDefinedDnsConfigRequestBody object

Definition: Specifies the request parameters for configuring user-defined domain name resolution for a load balancer.

Constraints: N/A

Range: N/A

Default value: N/A

Table 4 UserDefinedDnsConfigRequestBody

Parameter

Mandatory

Type

Description

public_domain_name_enable

No

Boolean

Definition: Specifies whether to enable public domain name resolution.

Constraints: N/A

Range:

  • true: Enable public domain name resolution.

  • false: Disable public domain name resolution.

Default value: false

public_dns_zone_name

No

String

Definition: Specifies the public zone that will be used to generate public domain names for the load balancer.

Constraints: Public domain names can only be generated based on public zones. If public domain name resolution is enabled, this parameter cannot be left blank. The public zone you specified must exist on the DNS console.

Range: N/A

Default value: N/A

public_dns_record_set_ttl

No

Integer

Definition: Specifies the cache duration of the public record set on a local DNS server. The longer the duration is, the slower the update takes effect. If your service address changes frequently, set TTL to a smaller value. Otherwise, set TTL to a larger value.

Constraints: N/A

Range: 1 to 2147483647

Default value: 300

private_domain_name_enable

No

Boolean

Definition: Specifies whether to enable private domain name resolution.

Constraints: N/A

Range:

  • true: Enable private domain name resolution.

  • false: Disable private domain name resolution.

Default value: false

private_dns_zone_name

No

String

Definition: Specifies the zone that will be used to generate private domain names for the load balancer.

Constraints:

  • This parameter is valid only when private_domain_name_enable is set to true.

  • If private_domain_name_enable is set to true, this parameter cannot be left blank.

  • The private zone you specified must exist on the DNS console.

  • Both public and private zones can be used to generate private domain names for the load balancer. The zone type is defined by private_dns_zone_type.

Range: N/A

Default value: N/A

private_dns_zone_type

No

String

Definition: Specifies the type of the zone that will be used to generate private domain names for the load balancer.

Constraints: N/A

Range:

  • private: A private zone will be used.

  • public: A public zone will be used.

Default value: private

private_dns_record_set_ttl

No

Integer

Definition: Specifies the cache duration of the private record set on a local DNS server. The longer the duration is, the slower the update takes effect. If your service address changes frequently, set TTL to a smaller value. Otherwise, set TTL to a larger value.

Constraints: N/A

Range: 1 to 2147483647

Default value: 300

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

loadbalancer

DnsConfigResponseBody object

Definition: Specifies the response parameters for configuring domain name resolution for a load balancer.

Table 6 DnsConfigResponseBody

Parameter

Type

Description

vip_address

String

Definition: Specifies the virtual IPv4 address of the load balancer.

ipv6_vip_address

String

Definition: Specifies the IPv6 address of the load balancer.

Constraints:

eips

Array of EipInfo objects

Definition: Specifies the EIPs bound to the load balancer.

NOTE:
This parameter has the same meaning as publicips.

global_eips

Array of GlobalEipInfo objects

Definition: Specifies the global EIPs bound to the load balancer.

public_domain_name_enable

Boolean

Definition: Specifies whether to enable public domain name resolution.

Range:

  • true: Enable public domain name resolution.

  • false: Disable public domain name resolution.

public_dns_zone_name

String

Definition: Specifies the public zone that will be used to generate public domain names for the load balancer.

Constraints:

  • Public domain names can only be generated based on public zones.

  • If public domain name resolution is enabled, this parameter cannot be left blank.

  • The public zone you specified must exist on the DNS console.

public_dns_zone_id

String

Definition:

Specifies the ID of the public zone.

The ID can be obtained based on the public zone name.

public_domain_name

String

Definition:

Specifies the public domain names of the load balancer.

Constraints:

The public domain names are generated in the following format:

{lb_id}.elb.{region_id}.{zone_name}

public_dns_record_set_ttl

Integer

Definition:

Specifies the cache duration of the public record set on a local DNS server.

The longer the duration is, the slower the update takes effect.

If your service address changes frequently, set TTL to a smaller value. Otherwise, set TTL to a larger value.

Range:

1 to 2147483647

Default value:

300

private_domain_name_enable

Boolean

Definition:

Specifies whether to enable private domain resolution.

Range:

  • true: Enable private domain name resolution.

  • false: Disable private domain name resolution.

private_dns_zone_name

String

Definition:

Specifies the zone that will be used to generate private domain names for the load balancer.

Constraints:

  • Both public and private zones can be used to generate private domain names for the load balancer. The zone type is defined by private_dns_zone_type.

  • If private domain name resolution is enabled, this parameter cannot be left blank.

  • The private zone you specified must exist on the DNS console.

private_dns_zone_id

String

Definition:

Specifies the ID of the private zone.

Constraints:

The ID can be obtained based on the private zone name.

private_domain_name

String

Definition: Specifies the private domain names of the load balancer.

Constraints: The private domain names are generated in the following format:

{lb_id}-internal.elb.{region_id}.{zone_name}

private_dns_zone_type

String

Definition: Specifies the type of the zone that will be used to generate private domain names for the load balancer.

Constraints: N/A

Range: private or public

Default value: private

private_dns_record_set_ttl

Integer

Definition:

Specifies the cache duration of the private record set on a local DNS server.

The longer the duration is, the slower the update takes effect.

If your service address changes frequently, set TTL to a smaller value. Otherwise, set TTL to a larger value.

Range:

1 to 2147483647

Default value:

300

Table 7 EipInfo

Parameter

Type

Description

eip_id

String

Definition: Specifies the EIP ID.

Range: N/A

eip_address

String

Definition: Specifies the EIP.

Range: N/A

ip_version

Integer

Definition: Specifies the IP address version.

Range:

  • 4: IPv4 addresses

  • 6: IPv6 addresses

Table 8 GlobalEipInfo

Parameter

Type

Description

global_eip_id

String

Definition: Specifies the ID of the global EIP.

Range: N/A

global_eip_address

String

Definition: Specifies the global EIP.

Range: N/A

ip_version

Integer

Definition: Specifies the IP address version.

Range:

  • 4: IPv4 addresses

  • 6: IPv6 addresses

Example Requests

Configuring user-defined domain name resolution for a load balancer

POST https://{ELB_Endpoint}/v3/{project_id}/elb/loadbalancers/{loadbalancer_id}/dns/user-defined-config

{
  "loadbalancer" : {
    "public_dns_zone_name" : "jpp.com",
    "public_domain_name_enable" : true,
    "public_dns_record_set_ttl" : 233333,
    "private_dns_zone_name" : "jpp-internal.com",
    "private_domain_name_enable" : true,
    "private_dns_record_set_ttl" : 9999999,
    "private_dns_zone_type" : "private"
  }
}

Example Responses

Status code: 200

Successful request.

{
  "loadbalancer" : [ {
    "vip_address" : "192.168.20.87"
  }, {
    "ipv6_vip_address" : "2001:db8:a583:682::10"
  }, {
    "eips" : null,
    "eip_id" : "26000000-0000-0000-0000-000000000001",
    "eip_address" : "10.185.106.199",
    "ip_version" : 4
  }, {
    "global_eips" : null,
    "global_eip_id" : "26000000-0000-0000-0000-000000000001",
    "global_eip_address" : "2001:db8:a583:682::11",
    "ip_version" : 6
  }, {
    "private_domain_name_enable" : true
  }, {
    "private_dns_zone_id" : "8a186e6692d7f30d0192d8472fba0479"
  }, {
    "private_dns_zone_name" : "test.private.com"
  }, {
    "private_domain_name" : "10000000-0000-0000-0000-000000000001-internal.elb.zunei.test.private.com"
  }, {
    "private_dns_record_set_ttl" : 3500
  }, {
    "public_domain_name_enable" : true
  }, {
    "public_dns_zone_id" : "9a186e6692d7f30d0192d8472fba0479"
  }, {
    "public_dns_zone_name" : "test.public.com"
  }, {
    "public_domain_name" : "10000000-0000-0000-0000-000000000001.elb.zunei.test.public.com"
  }, {
    "public_dns_record_set_ttl" : 300
  } ]
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.