Support SRV records
Would you be willing to entertain supporting SRV records so hostnames are used for the node connections instead of IP addresses?
There is no use for the priority field in the SRV records but it would be nice if we could automagically leverage the port field. Unfortunately it appears Erlang doesn't allow you to specify the port when making a connection and you need to use ERL_EPMD_PORT environment variable or maybe a vm.args setting to modify it?
Hey I would love to help get this in, as we use this at work. In fact this is the suggested path for Fargate containers (although they also suggest a records).
This is the payload from a srv record:
{:ok,
{:hostent, ~c"x.local", [], :srv, 3,
[
{1, 1, 4369, ~c"sfasdfsadfaes4f4.x.local"},
{1, 1, 4369, ~c"3fq32r23fa3fa23f.x.local"},
{1, 1, 4369, ~c"aw3faw34r234234r.x.local"}
]}}
This looks good to me but we should make the types of queries customizable, with the default of :a or :aaaa. WDYT?
Personally that makes sense to me, as an future end-user of this API.
In case @feld does not have time to update this (which is very understandable since it took us forever to reply), someone else is welcome to send a PR on top with the changes proposed above. :)