From 0dda40b51ffee6d099cca1c078f3313a587ea5e5 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Tue, 19 Sep 2023 14:46:25 -0400 Subject: [PATCH] Backport of Fix code block examples on dns-static-lookups.mdx into release/1.15.x (#18893) Fix code block examples on dns-static-lookups.mdx HCL and JSON configuration examples were being displayed in the same code block. This commit separates the configurations to properly display them as independent configuration examples. Co-authored-by: Blake Covarrubias --- .../services/discovery/dns-static-lookups.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/website/content/docs/services/discovery/dns-static-lookups.mdx b/website/content/docs/services/discovery/dns-static-lookups.mdx index 353f4e2628..c0854bf62a 100644 --- a/website/content/docs/services/discovery/dns-static-lookups.mdx +++ b/website/content/docs/services/discovery/dns-static-lookups.mdx @@ -234,11 +234,13 @@ _redis._tcp.service.phx1.peer.consul. 0 IN SRV 1 1 29142 0a010d56.addr.consul. If a service registered with Consul is configured with an explicit IP address or addresses in the [`address`](/consul/docs/services/configuration/services-configuration-reference#address) or [`tagged_address`](/consul/docs/services/configuration/services-configuration-reference#tagged_address) parameter, then Consul returns the hostname in the target field of the answer section for the DNS SRV query according to the following format: ```text -.addr..consul`. +.addr..consul. ``` In the following example, the `rabbitmq` service is registered with an explicit IPv4 address of `192.0.2.10`. + + ```hcl node_name = "node1" @@ -247,6 +249,9 @@ services { address = "192.0.2.10" port = 5672 } +``` + +```json { "node_name": "node1", "services": [ @@ -259,6 +264,8 @@ services { } ``` + + The following example SRV query response contains a single record with a hostname written as a hexadecimal value: ```shell-session @@ -275,6 +282,8 @@ $ echo -n "c000020a" | perl -ne 'printf("%vd\n", pack("H*", $_))' In the following example, the `rabbitmq` service is registered with an explicit IPv6 address of `2001:db8:1:2:cafe::1337`. + + ```hcl node_name = "node1" @@ -283,6 +292,9 @@ services { address = "2001:db8:1:2:cafe::1337" port = 5672 } +``` + +```json { "node_name": "node1", "services": [ @@ -295,6 +307,8 @@ services { } ``` + + The following example SRV query response contains a single record with a hostname written as a hexadecimal value: ```shell-session