fix: avoid macOS mDNS 5s delay on .local hosts entries - #96
Conversation
If applied, this commit will make the documented /etc/hosts lines for
the core and stepup environments resolve instantly on macOS instead
of taking ~5 seconds per fresh hostname lookup.
Why is this change needed?
Prior to this change, the /etc/hosts lines had the IP address
followed directly by a real hostname. On macOS, any .local hostname
looked up this way is first tried via multicast DNS (Bonjour), which
times out after ~5 seconds before falling back to /etc/hosts --
regardless of the entry being present. A typical login flow crosses
several *.dev.openconext.local subdomains in sequence, so this tax
stacks up to several seconds per redirect hop.
How does it address the issue?
Adds a throwaway alias word ("oc1"/"oc2") directly after the IP
address on each affected line. A word in that position is enough to
make macOS treat the line as a normal /etc/hosts entry and skip the
mDNS attempt, cutting resolution to milliseconds. Updates both
README.md files and the line init.sh prints during setup, with a
short comment explaining why the leading word is there.
Links / references:
https://www.peterbe.com/plog/make-.local-domains-not-slow-in-macos
|
Use ipv6 instead of the hack |
|
Note that We however use |
If applied, this commit will make the documented /etc/hosts lines for the core and stepup environments resolve instantly on macOS instead of taking ~5 seconds per fresh hostname lookup.
Why is this change needed?
Prior to this change, the /etc/hosts lines had the IP address followed directly by a real hostname. On macOS, any .local hostname looked up this way is first tried via multicast DNS (Bonjour), which times out after ~5 seconds before falling back to /etc/hosts -- regardless of the entry being present. A typical login flow crosses several *.dev.openconext.local subdomains in sequence, so this tax stacks up to several seconds per redirect hop.
How does it address the issue?
Adds a throwaway alias word ("oc1"/"oc2") directly after the IP address on each affected line. A word in that position is enough to make macOS treat the line as a normal /etc/hosts entry and skip the mDNS attempt, cutting resolution to milliseconds. Updates both README.md files and the line init.sh prints during setup, with a short comment explaining why the leading word is there.
Links / references:
https://www.peterbe.com/plog/make-.local-domains-not-slow-in-macos