# Builtin support for node auto connection, reconnection and maybe DNS discovery

**URL:** <https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276>\
**Category:** Proposals: Ideas\
**Tags:** distributed-erlang\
**Created:** [December 9, 2024, 7:16pm UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276 "2024-12-09T19:16:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsloughter](https://erlangforums.com/user_avatar/erlangforums.com/tsloughter/32/418_2.png) [@tsloughter](https://erlangforums.com/u/tsloughter)\
**Post date:** [December 9, 2024, 7:16pm UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276/1 "2024-12-09T19:16:39Z")

</div>

I considered doing my new library `gen_cluster`, see [Gen\_cluster - New library for cluster formation](https://erlangforums.com/t/gen-cluster-new-library-for-cluster-formation/4273), as an `epmd_module` ([Erlang -- How to Implement an Alternative Service Discovery for Erlang Distribution](https://www.erlang.org/docs/21/apps/erts/alt_disco)) + loop but decided against it. But what I’d like to see is not to need a library (in either form) necessary for DNS discovery + auto connection.

Before I build a second library as a POC (really just a copy of `gen_cluster`) that has the user set discovery with `-epmd_module` and only supports calling `erl_epmd:names()` I thought I’d bring up this idea. I suppose DNS doesn’t have to be included in OTP for the addition to be useful, just auto connection to the returned values of `names()`?

---

<div class="post-metadata">

**Author:** ![wravoc](https://erlangforums.com/user_avatar/erlangforums.com/wravoc/32/2647_2.png) [@wravoc](https://erlangforums.com/u/wravoc)\
**Post date:** [December 11, 2024, 10:55pm UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276/2 "2024-12-11T22:55:55Z")

</div>

This is awesome and it made me think why all these things together aren’t std and yet how DNS is such a minefield. I’m also folding in EFF’s [Positioning Erlang ecosystem as “secure"](https://erlangforums.com/t/security-working-group-minutes/3451/2#positioning-erlang-ecosystem-as-secure-6) and pondering if this issue is a fulcrum between features and security.

After all, it may be that integrating high level “auto-discovery” would be the next big phase of Erlang. Would that be worth enlarging the security surface by orders of magnitude? I don’t know, it depends.

I myself am thinking about node discovery without the use of DNS that is also not Erlang specific.

I may have any parts of the above wrong, I’m still learning! I’ve marked this issue for me personally as pivotal to the language future though as I naturally assumed this type of behavior was part of the “killer feature” of Erlang to begin with.

---

<div class="post-metadata">

**Author:** ![ieQu1](https://erlangforums.com/user_avatar/erlangforums.com/iequ1/32/2633_2.png) [@ieQu1](https://erlangforums.com/u/ieQu1)\
**Post date:** [December 12, 2024, 8:07am UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276/3 "2024-12-12T08:07:43Z")

</div>

Just FYI, there’s another library for cluster management and discovery [GitHub - emqx/ekka: Autocluster and Autoheal for EMQX Broker](https://github.com/emqx/ekka/) it manages mnesia as well. It’s not EMQX specific (despite the description).

---

<div class="post-metadata">

**Author:** ![tsloughter](https://erlangforums.com/user_avatar/erlangforums.com/tsloughter/32/418_2.png) [@tsloughter](https://erlangforums.com/u/tsloughter)\
**Post date:** [December 16, 2024, 10:24am UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276/4 "2024-12-16T10:24:54Z")

</div>

Neat, I’d never heard of that one and would never have realized what it did since its description is “for EMQX Broker”. Wish I’d known about it, I’ll hvae to investigate more to see if either I can learn from it or should ask them to re-“market” it as a general solution and already sunset `gen_cluster`, haha.

---

<div class="post-metadata">

**Author:** ![tsloughter](https://erlangforums.com/user_avatar/erlangforums.com/tsloughter/32/418_2.png) [@tsloughter](https://erlangforums.com/u/tsloughter)\
**Post date:** [December 16, 2024, 11:21am UTC](https://erlangforums.com/t/builtin-support-for-node-auto-connection-reconnection-and-maybe-dns-discovery/4276/5 "2024-12-16T11:21:26Z")

</div>

Actually looking at [GitHub - emqx/ekka: Autocluster and Autoheal for EMQX Broker](https://github.com/emqx/ekka?tab=readme-ov-file#autoheal-design) it may not be so general purpose after all.
