You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: revert to simple ip netns exec with documented limitations
After extensive attempts to safely modify /etc/resolv.conf in mount namespaces,
I've learned that **mount namespaces only isolate mount tables, not filesystems**.
Any file operations (rm, cp, touch) always affect the host, regardless of mount
propagation settings.
Solution: Accept the limitation and use the standard ip netns exec approach:
- Works perfectly when /etc/resolv.conf is a regular file
- May fail to bind-mount when /etc/resolv.conf is a symlink to non-existent target
- DNS still works via nftables interception even if bind-mount fails
- Host's /etc/resolv.conf is NEVER modified
This is the safest approach. The alternative (modifying files in mount namespaces)
is fundamentally unsafe and corrupted the host's resolv.conf multiple times during
testing.
Tested on ml-1 with external DNS (8.8.8.8) - all 23 tests pass, host resolv.conf
remains untouched.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments