I have a shiny app that finds a backend plumber API via a DNS A record (hitting a HTTP endpoint on a static port) that I need to move over to use SRV records. SRV records return a port and a target hostname and the target hostname needs to be also looked up and resolved to hit the proper endpoint. SRV records like this are a pretty common pattern in microservices but I'm not finding any tools that will allow me to query this DNS record type and get an ultimate hostname and port combination out of the box.
I can write something to pipe to a system level nslookup or dig interface, but as this code will be deployed in a docker container with a minimal userland, I'd love to avoid having to specify a hard dependency on a particular command line tool.
Have any services-oriented architects wrangled this sort of pattern before? Tips and pointers?