Skip to content

Announcements to discovery server include extra IP information #10503

Closed

Description

@NealPierceGH

What happened?

I'm testing syncthing on a closed (not public) controlled environment heavily relying on DNS (split views and all). The test setup consists of 3 hosts, 2 fixed IP servers at different locations and a traveling laptop. I've set up a private discovery server on a publicly accessible address so hosts can find each other. The laptop is not yet involved in the process but I see potential problems with the next part.

On each fixed IP server the config.xml is configured as such

<listenAddress>tcp://sync.example.com:22000</listenAddress>
<listenAddress>quic://sync.example.com:22000</listenAddress>
<globalAnnounceServer>https://disco.example.com</globalAnnounceServer>
<globalAnnounceServer>https://disco.foobar.com</globalAnnounceServer>
<globalAnnounceEnabled>true</globalAnnounceEnabled>

and

<listenAddress>tcp://sync.foobar.com:22000</listenAddress>
<listenAddress>quic://sync.foobar.com:22000</listenAddress>
<globalAnnounceServer>https://disco.example.com</globalAnnounceServer>
<globalAnnounceServer>https://disco.foobar.com</globalAnnounceServer>
<globalAnnounceEnabled>true</globalAnnounceEnabled>

With the split DNS config, each server have an internal IP within the lab and the public one for everyone else.

When syncthing sends the announcement it goes like this
DBG send announcement (server=https://disco.example.com announcement="{[tcp://sync.example.com:22000 tcp://0.0.0.0:0 quic://sync.example.com:22000]}" log.pkg=discover log.type=globalclient log.src.file=global.go log.src.line=279)
and
DBG send announcement (server=https://disco.foobar.com announcement="{[tcp://sync.example.com:22000 tcp://0.0.0.0:0 quic://sync.example.com:22000]}" log.pkg=discover log.type=globalclient log.src.file=global.go log.src.line=279)

Why the extraneous tcp://0.0.0.0:0?

Then, requesting each discovery server shows the internal IP of each server which is not desired!

$ curl -s 'https://disco.foobar.com/?device=ID_OF_SERVER1' | jq .
{
  "seen": "2025-12-21T18:07:29+01:00",
  "addresses": [
    "quic://sync.example.com:22000",
    "tcp://10.1.1.63:22000",
    "tcp://sync.example.com:22000"
  ]
}

and the other way around of course. Each external discovery server gets the internal IP because syncthing sends it without being asked to do so.

If this is intended behavior, would it then be possible to add an option to disable that and only send what's specified on the listenAddress lines?

Syncthing version

v2.0.12

Platform & operating system

Linux amd64

Browser version

No response

Relevant log output

Activity

  1. added theissue type on Dec 21, 2025
  2. added
    bug
    needs-triage
    on Dec 21, 2025
  3. calmh commented on Dec 21, 2025

    @calmh
    Member

    It's intended yes, the unspecified address is interpreted as the address the announcement comes from, which is effectively the only or most important one for normal dynamic clients. If I remember correctly it's sent when Syncthing listens on a wildcard address.

  4. NealPierceGH commented on Dec 22, 2025

    @NealPierceGH
    Author

    Yeah but as I didn't specified dynamic in the config, I'd like syncthing to respect that and not send this barebones IP.

    Only send (server=https://disco.example.com announcement="{[tcp://sync.example.com:22000 quic://sync.example.com:22000]}" and nothing else.

    For my servers it's not a problem because I control them and there's no issue but for my laptop it's another story. When I work for sensitive clients inside their network where every single connection to their internal hosts is monitored, I may inadvertently raise some eyebrows because by some dumb luck, their network addressing and mine are too similar and they see my laptop trying to connect to their hosts. (Already happened that's why I mention it)

    As mentioned in my first message, I'd vote for an option in the XML config to disable that and only advertise hostnames exactly as stated in listenAddress, pretty please 😄

  5. added a commit that references this issue on May 23, 2026
    6322091
  6. added a commit that references this issue on Jun 4, 2026
    4eb00ab
  7. added a commit that references this issue on Jun 28, 2026
    a4dadaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions