Skip to content

fix(fish): route DNS through exit node so vpn works - #2084

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/vpn-accept-dns
Jul 16, 2026
Merged

fix(fish): route DNS through exit node so vpn works#2084
shunkakinoki merged 1 commit into
mainfrom
fix/vpn-accept-dns

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

_vpn_function.fish set the Tailscale exit node but not --accept-dns. With CorpDNS: false in prefs, DNS stayed pointed at 1.1.1.1/8.8.8.8 and those UDP:53 queries failed through the tunnel - traffic routed but name resolution broke (http:000), which read as "VPN not working".

Changes

  • on / toggle-on: tailscale set --exit-node=kyber --accept-dns=true
  • off / toggle-off: tailscale set --exit-node= --accept-dns=false

Testing

  • make fish-test -> 414 passing
  • vpn on -> exit-node IP (91.242.214.231), DNS resolves
  • vpn off -> direct IP (203.106.130.122)

Summary by cubic

Fixes VPN name resolution by routing DNS through the tailscale exit node in _vpn_function.fish. Turning VPN off now restores local DNS.

  • Bug Fixes
    • On: tailscale set --exit-node=$kyber_host --accept-dns=true
    • Off/Toggle off: tailscale set --exit-node= --accept-dns=false

Written for commit 354fb4e. Summary will update on new commits.

Review in cubic

@indent-zero

indent-zero Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Fixes broken name resolution while the Tailscale exit-node VPN is engaged by teaching the fish vpn helper to flip --accept-dns alongside --exit-node. Without this, DNS queries stayed on the local resolver even when tunnelled — because nix-darwin/config/networking.nix sets --accept-dns=false at activation for split-DNS — so lookups that depended on the exit node's DNS view failed.

  • vpn on now runs tailscale set --exit-node=$kyber_host --accept-dns=true so DNS is routed through the exit node
  • vpn off now runs tailscale set --exit-node= --accept-dns=false, realigning with the declarative macOS split-DNS baseline
  • Toggle (vpn with no args) applies the same paired flags in both on/off branches
  • Adds an inline comment on the on path explaining why --accept-dns=true is required

Issues

2 potential issues found:

  • vpn off and toggle-off unconditionally set --accept-dns=false; this matches the macOS split-DNS baseline today, but on any future host that relies on Tailscale MagicDNS while the exit node is off, running vpn off will silently disable .ts.net name resolution until re-enabled manually. → Autofix
  • Nit: only the on branch has an explanatory comment; the off and toggle-off branches flip --accept-dns=false without noting they are deliberately restoring the declarative split-DNS baseline from nix-darwin/config/networking.nix. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@shunkakinoki
shunkakinoki merged commit 2b09f5f into main Jul 16, 2026
24 of 26 checks passed
@shunkakinoki
shunkakinoki deleted the fix/vpn-accept-dns branch July 16, 2026 17:59
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@shunkakinoki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb33fe83-c10b-40e7-b443-a88839e901fa

📥 Commits

Reviewing files that changed from the base of the PR and between ab5f8a7 and 354fb4e.

📒 Files selected for processing (1)
  • home-manager/programs/fish/functions/_vpn_function.fish
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/vpn-accept-dns

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mesa-dot-dev

mesa-dot-dev Bot commented Jul 16, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Enables Tailscale DNS acceptance when routing through the exit node to prevent DNS resolution failures when the VPN is active.

What changed?

  • _vpn_function.fish:
    • Updated vpn on toggle to use tailscale set --exit-node=kyber --accept-dns=true to route DNS through the exit node.
    • Updated vpn off toggle to use tailscale set --exit-node= --accept-dns=false to disable DNS routing and clear the exit node.

Description generated by Mesa. Update settings

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Performed full review of ab5f8a7...354fb4e

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 0 comments | Edit Agent SettingsRead Docs

and echo "VPN connected through kyber"
case off
tailscale set --exit-node=
tailscale set --exit-node= --accept-dns=false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Latent: off hard-disables accept-dns regardless of host baseline — This currently matches nix-darwin/config/networking.nix:33-37, which activates with tailscale set --accept-dns=false alongside the /etc/resolver/ts.net split-DNS setup, so on macOS it correctly restores the declared baseline. On a host that instead relies on Tailscale MagicDNS while the exit node is off (e.g. a future Linux/NixOS machine using this same fish function), vpn off will flip --accept-dns to false and silently break .ts.net lookups until the user re-enables it. Worth either scoping this to macOS or reading the current preference before overwriting.

and echo "VPN connected through kyber"
case off
tailscale set --exit-node=
tailscale set --exit-node= --accept-dns=false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: add a symmetric comment on the off path — The on branch documents why --accept-dns=true is required, but the two branches that pass --accept-dns=false are silent. Since this pairs with the activation script in nix-darwin/config/networking.nix:33-37 (which sets --accept-dns=false and configures /etc/resolver/ts.net for split-DNS), a one-line comment on line 11 would prevent a future reader from stripping the flag as dead code.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the _vpn_function script to include --accept-dns settings when toggling the Tailscale exit node. Specifically, it enables DNS routing through the exit node when connected and disables it when disconnected to ensure proper name resolution while tunneled. I have no further feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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