Add --mdns-domain flag to customize mDNS hostname #8335

Closed
opened 2026-02-16 18:09:42 -05:00 by yindo · 1 comment
Owner

Originally created by @luiz290788 on GitHub (Feb 2, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Summary

When using opencode web --mdns, the server is always advertised as opencode.local. It would be useful to allow customizing this domain name via a flag.

Use Case

When running multiple OpenCode instances on the same network, or when wanting to use a more descriptive name for a specific project/machine, being able to customize the mDNS domain would help distinguish between servers.

Proposed Solution

Add a --mdns-domain flag (or similar) to override the default opencode.local hostname:

opencode web --mdns --mdns-domain myproject.local

And support it in the config file as well:

{
  "server": {
    "mdns": true,
    "mdnsDomain": "myproject.local"
  }
}

Alternatives Considered

  • Using --hostname with a specific IP and configuring DNS/hosts manually, but this defeats the purpose of mDNS auto-discovery.
Originally created by @luiz290788 on GitHub (Feb 2, 2026). Originally assigned to: @adamdotdevin on GitHub. ## Summary When using `opencode web --mdns`, the server is always advertised as `opencode.local`. It would be useful to allow customizing this domain name via a flag. ## Use Case When running multiple OpenCode instances on the same network, or when wanting to use a more descriptive name for a specific project/machine, being able to customize the mDNS domain would help distinguish between servers. ## Proposed Solution Add a `--mdns-domain` flag (or similar) to override the default `opencode.local` hostname: ```bash opencode web --mdns --mdns-domain myproject.local ``` And support it in the config file as well: ```json { "server": { "mdns": true, "mdnsDomain": "myproject.local" } } ``` ## Alternatives Considered - Using `--hostname` with a specific IP and configuring DNS/hosts manually, but this defeats the purpose of mDNS auto-discovery.
yindo added the web label 2026-02-16 18:09:42 -05:00
yindo closed this issue 2026-02-16 18:09:43 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9040: mDNS service not discoverable with correct hostname (already addressed hostname/discovery issues)
  • #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use (relates to running multiple instances on the same network)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 2, 2026): This issue might be a duplicate of existing issues. Please check: - #9040: mDNS service not discoverable with correct hostname (already addressed hostname/discovery issues) - #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use (relates to running multiple instances on the same network) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8335