Skip to content

chore: change DNS record TTL from 10 minutes to 2 seconds #70

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

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Apr 9, 2025

Relates to coder/internal#466

This modifies the TTL of all DNS records programmed into the DNS resolver.

I've tested this by running Coder Desktop macOS against a fresh dylib:

$ dig -6 @fd60:627a:a42b::53 pog2.coder AAAA

; <<>> DiG 9.10.6 <<>> -6 @fd60:627a:a42b::53 pog2.coder AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37590
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;pog2.coder.			IN	AAAA

;; ANSWER SECTION:
pog2.coder.		2	IN	AAAA	fd60:627a:a42b:415e:bb03:e708:fd73:c6cb

;; Query time: 6 msec
;; SERVER: fd60:627a:a42b::53#53(fd60:627a:a42b::53)
;; WHEN: Wed Apr 09 15:14:20 AEST 2025
;; MSG SIZE  rcvd: 66

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review April 9, 2025 05:17
// Coder: We've changed this from 10 minutes to 2 seconds, as we'd like to use
// the existence of Coder Connect DNS records to determine whether Coder Connect
// is running.
const defaultTTL = 2 * time.Second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 seconds sounds better to me. The only time that records will conflict will be during a restart of a workspace, which I would guess takes 20-30 seconds in the fastest possible template.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't just worried about records with conflicting IP addresses, we are worried about turning off Coder Connect entirely and then using some other tool to connect to the workspace, and having the OS return a stale record indicating that Coder Connect is running when it isn't.

So, the relevant time scale is how quickly a human can turn off Coder Connect and then switch to another tool, not a workspace restart.

Copy link
Member Author

ethanndickson commented Apr 10, 2025

Merge activity

  • Apr 10, 12:11 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 10, 12:11 AM EDT: A user merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit e62bfe0 into main Apr 10, 2025
31 of 35 checks passed
ethanndickson added a commit to coder/coder that referenced this pull request Apr 11, 2025
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

Successfully merging this pull request may close these issues.

3 participants