Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected TTL #266

Open
stodge opened this issue Jan 30, 2024 · 0 comments
Open

Unexpected TTL #266

stodge opened this issue Jan 30, 2024 · 0 comments

Comments

@stodge
Copy link

stodge commented Jan 30, 2024

I'm using jmDNS 3.5.9 in two applications; an emulator (essentially a server) and a client. The server and client are both running on the same Windows 11 PC.

The emulator manages the services; each service has a button that the user presses to create and register that service. The 5 services are:

  • SERVICE1._TESTNET._udp.local
  • SERVICE2._TESTNET._udp.local
  • SERVICE3._TESTNET._udp.local
  • SERVICE4._TESTNET._udp.local
  • SERVICE5._TESTNET._udp.local

The client automatically subscribes to the service type (e.g., "_TESTNET._udp.local").

My steps are:

  • Start Wireshark capture, filter on mdns
  • Start emulator
    • User registers first service (let's just call it SERVICE1 for clarity and brevity here) on emulator
  • Monitor PCAP
    • For SERVICE1, TTL=2 minutes
  • Start client - automatically subscribes to service type
    • Wait for the client to detect SERVICE1
    • User registers 4 other services (e.g., SERVICE2, SERVICE3 and SERVICE4) on emulator
  • Monitor PCAP
    • SERVICE1 is republished, TTL=1 hour <=== ????
    • For services SERVICE2, SERVICE3 and SERVICE4, TTL=2 minutes

There are two mDNS cache flush records for SERVICE1 after the client starts. The first record has a TTL of 1 hour, and the second record (re-transmitted response) has a TTL of 2 minutes.

I'm trying to override the default TTL with:

        // Override the default TTL.
        DNSStateTask.setDefaultTTL(120);

        Properties props = System.getProperties();
        props.setProperty("net.dns.ttl", String.valueOf(120));

Is there any way to always set the TTL to a specific value for a service or service type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant