Login
You're viewing the ruby.social public feed.
  • Apr 12, 2026, 12:41 PM

    Users of #UNIX daemons, what would you prefer to happen when binding to a name that resolves to multiple addresses?

    💬 1🔄 0⭐ 0

Replies

  • Apr 12, 2026, 12:43 PM

    For some clarification, many names resolve at least to an IPv4 and an IPv6 address. Multiple addresses happen in systems with multiple uplinks, and especially on IPv6, ULA addresses are also popular resolution targets because they work even when there is trouble with the ISP.

    💬 0🔄 0⭐ 0
  • Apr 12, 2026, 12:44 PM

    I'm asking "prefer" and not "expect" because the plain bind() syscall binds to only a single address (unless the name is literally :: or 0.0.0.0), because that's the only case in which a single socket can be bound to multiple addresses at all. But a service / daemon is free to resolve the name manually and serve a socket per resolved address.

    💬 0🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Apr 12, 2026, 1:01 PM

    @thejpster It appears to bind to just one. (I don't see how Rust could do anything different, given that no OS I know will have a multiply bound socket outside of ::, and Rust does expose a single file descriptor per listener).

    💬 0🔄 0⭐ 0