--- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -600,6 +600,13 @@ static bool open_sockets_smbd(struct smb continue; } + /* Keep the first port for mDNS service + * registration. + */ + if (dns_port == 0) { + dns_port = port; + } + if (!smbd_open_one_socket(parent, ifss, port)) { return false; }