Consul responds to SRV queries with its own hostname?

Why does Consul return its own hostname in SRV records instead of the
registered service’s hostname?

This behavior confuses client libraries–in my case, Spotify’s DNS
wrapper library–which uses the SRV record’s hostname verbatim. The only
way I can get SRV lookup to work as expected is to register the IP
address as the service address. This won’t work if the service is behind
any kind of DNS load balancing of its own which may be the case for
external services.

A simple test case is below:

$ docker run --rm -it --name test1 --net-alias test1.foo.priv -d nginx
$ docker run --rm -it --name test2 --net-alias test2.foo.priv -d nginx

$ docker exec consul consul services register -name test1 -address test1.foo.priv -port 80
$ docker exec consul consul services register -name test2 -address 10.0.0.23 -port 80

$ docker exec consul dig @127.0.0.1 test1.service.consul SRV

; <<>> DiG 9.12.4-P2 <<>> @127.0.0.1 test1.service.consul SRV
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4589
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test1.service.consul.  IN  SRV

;; ANSWER SECTION:
test1.service.consul. 0 IN  SRV 1 1 80 consul-docker.node.mydc.consul.

;; ADDITIONAL SECTION:
consul-docker.node.mydc.consul. 0 IN  CNAME test1.foo.priv.
test1.foo.priv. 600 IN  A 10.0.0.22
consul-docker.node.mydc.consul. 0 IN  TXT "consul-network-segment="

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue May 05 13:08:30 UTC 2020
;; MSG SIZE  rcvd: 187

$ docker exec consul dig @127.0.0.1 test2.service.consul SRV

; <<>> DiG 9.12.4-P2 <<>> @127.0.0.1 test2.service.consul SRV
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49883
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test2.service.consul.  IN  SRV

;; ANSWER SECTION:
test2.service.consul. 0 IN  SRV 1 1 80 0a210017.addr.mydc.consul.

;; ADDITIONAL SECTION:
0a210017.addr.mydc.consul. 0  IN  A 10.0.0.23
consul-docker.node.mydc.consul. 0 IN  TXT "consul-network-segment="

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue May 05 13:08:36 UTC 2020
;; MSG SIZE  rcvd: 169

I would expect dig test1.service.consul SRV to return the machine’s
service-registered hostname, i.e., test1.foo.priv, not Consul’s
hostname. What am I doing wrong here?