michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
310 stars 50 forks source link

DNS-SD registrations are not updated when the hostname changes #282

Closed michaelrsweet closed 1 year ago

michaelrsweet commented 1 year ago

PAPPL passes system->hostname when registering services, but doesn't update those registrations when system->hostname changes. Need to force re-registration, otherwise the target host for the services will still point to the old hostname...

michaelrsweet commented 1 year ago

Investigating - this happens for Avahi already, just mDNSResponder that doesn't keep track of name changes...

michaelrsweet commented 1 year ago

Preliminary fix pushed to master and v1.3.x:

[master 10ecdc8] Fix hostname change detection with mDNSResponder (Issue #282)

[v1.3.x ef29596] Fix hostname change detection with mDNSResponder (Issue #282)

michaelrsweet commented 1 year ago

Needed some Apple-specific code, too:

[master 42b2750] Add Apple-specific hostname change detection (Issue #282)

[v1.3.x 87158d7] Add Apple-specific hostname change detection (Issue #282)

michaelrsweet commented 1 year ago

Actually, found a better way to track hostname changes with mDNSResponder that works on macOS and other mDNSResponder platforms with the same code:

[master f91eab7] Switch to using a PTR record query for the loopback address to get hostname changes with mDNSResponder (Issue #282)

[v1.3.x 6f14994] Switch to using a PTR record query for the loopback address to get hostname changes with mDNSResponder (Issue #282)