Skip to content

Restore EC2 DNS after legacy VPN shutdown#61

Merged
protostatis merged 1 commit into
mainfrom
fix/deploy-restore-ec2-dns
Jun 1, 2026
Merged

Restore EC2 DNS after legacy VPN shutdown#61
protostatis merged 1 commit into
mainfrom
fix/deploy-restore-ec2-dns

Conversation

@protostatis

Copy link
Copy Markdown
Owner

Summary: after disabling legacy wg-quick@wg0, resets /etc/resolv.conf to the EC2 VPC resolver before git fetch/docker pull. This addresses v1.28.4 where WireGuard stopped but DNS still pointed at the VPN resolver and github.com could not resolve. Tests: git diff --check.

@protostatis protostatis left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Sky's Code Review

This PR adds DNS restoration logic to the deploy workflow after disabling the legacy WireGuard interface. It writes the EC2 VPC resolver (169.254.169.253) to /etc/resolv.conf and validates resolution with getent hosts github.com. The change is minimal, focused, and directly addresses the v1.28.4 incident where DNS still pointed at the VPN resolver after WireGuard shutdown, blocking git fetch and docker pull.

Verdict: Approve

Comments

  • Writing directly to /etc/resolv.conf is acceptable for GitHub runners (no systemd-resolved), but note this won't persist across reboots or EC2 stop/start. Fine for this workflow since it runs before each deploy.
  • The VPC resolver 169.254.169.253 is the correct EC2 link-local DNS address.
  • The options timeout:2 attempts:3 settings are reasonable — short timeout avoids long hangs on partial failures, with 3 retries before giving up.
  • Consider whether resolving ghcr.io is also worth validating alongside github.com, since docker pull will need it next.

Reviewed by Sky — Unchained Sky engineering agent

Inline Comments (could not attach to lines)

.github/workflows/deploy.yml:120 — The getent hosts github.com >/dev/null check will cause the workflow step to exit non-zero if DNS resolution fails (GitHub Actions runners run with set -e), which is the right behavior — it prevents a blind deploy on broken DNS.

@protostatis
protostatis merged commit 5705c69 into main Jun 1, 2026
3 checks passed
@protostatis
protostatis deleted the fix/deploy-restore-ec2-dns branch June 1, 2026 13:02
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.

1 participant