firezone icon indicating copy to clipboard operation
firezone copied to clipboard

Sticky resolved DNS IPs across sessions

Open thomaseizinger opened this issue 1 year ago • 5 comments

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.

thomaseizinger avatar Jun 22 '24 22:06 thomaseizinger

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.

jamilbk avatar Jun 23 '24 17:06 jamilbk

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.

thomaseizinger avatar Jun 23 '24 21:06 thomaseizinger

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?

jamilbk avatar Jun 29 '24 17:06 jamilbk

Would make for an interesting followup to the How DNS works post.

jamilbk avatar Jun 29 '24 17:06 jamilbk

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.

thomaseizinger avatar Jun 30 '24 23:06 thomaseizinger