DNS query service meta information


I must be missing something obvious, just playing around with Consul and trying to query the service meta data via DNS. Here is my service JSON and I subsequently have run consul reload

/ # cat /consul/config/counting.json 
  "service": {
    "name": "counting",
    "meta": {
      "author": "John Smith",
      "version": "1.0.0",
      "description": "A web application for managing customer accounts"
    "tags": ["go"],
    "port": 9001

But when I do a SRV DNS query, I don’t get the metadata. Is it not possible to get the service metadata?

dig @ -p 8600 counting.service.consul SRV

; <<>> DiG 9.16.1-Ubuntu <<>> @ -p 8600 counting.service.consul SRV
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6131
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 3
;; WARNING: recursion requested but not available

; EDNS: version: 0, flags:; udp: 4096
;counting.service.consul.	IN	SRV

counting.service.consul. 0	IN	SRV	1 1 9001 client-1.node.dc1.consul.

client-1.node.dc1.consul. 0	IN	A
client-1.node.dc1.consul. 0	IN	TXT	"consul-network-segment="

;; Query time: 0 msec
;; WHEN: Wed Apr 26 10:30:46 EDT 2023
;; MSG SIZE  rcvd: 148

I think you may have just imagined the existence of a nonexistent feature?

Do you have any links to documentation which indicates any exposure of service metadata over DNS?

Hi @rishid_hashicorp,

maxb is correct, the DNS server does not currently send service metadata as TXT records in DNS responses. This is currently only supported for node metadata, and is enabled by default, but can be toggled using the dns_config.enable_additional_node_meta_txt agent configuration option.

Someone opened a GitHub issue a few years ago requesting support for sending service metadata, but it hasn’t seen a lot of interest and so it has not yet been selected for development.