Sticky resolved DNS IPs across sessions
The new DNS design ensures we have sticky IPs across connection restarts. It might also be worth adapting this to ensure sticky IPs across sign-in sessions.
Why? Because the way to fix computer problems is to turn things off and on again and doing that for firezone will reset all DNS state which might cause even more problems.
Yeah @conectado and I discussed this before. It's an interesting idea. It would certainly help rule out some variables when trying to reproduce issues.
I think there's a small chance it could go both ways though -- what if there's an IP collision with a non-Firezone host? I suppose the permanent solution there is #5403.
what if there's an IP collision with a non-Firezone host?
That is a problem regardless, right? Currently that will manifest as "things don't work after a while" (once a DNS query hits the collided IP). With a deterministic assignment, it should at least always affect the same hostname which is more dererministic and probably easier to debug.
This is a fairly low-risk change, right? Simply reduce the DNS name to an IP in our range using your favorite hash function and increment in case of collision?
Would make for an interesting followup to the How DNS works post.
This is a fairly low-risk change, right? Simply reduce the DNS name to an IP in our range using your favorite hash function and increment in case of collision?
It might end up taking a bit more memory because we need to remember all IPs every given out over the course of a session. Currently, we can clear the IPs if they the resource happened to be removed but as I am saying this, I realise that is not a very common user workflow.
Also, collisions might make them non-sticky again, depending on which order they occur in. But I guess that too isn't a very strict requirement unless we run into an edgecase where very popular domains happen to constantly collide.