Skip to content

Conversation

@gursewak1997
Copy link
Collaborator

@gursewak1997 gursewak1997 commented Dec 18, 2025

PR #167 introduced DNS filtering that excluded all private IP addresses (10.x, 172.16-31.x, 192.168.x, fc00::/7) assuming they would be unreachable from QEMU's slirp networking. However, this breaks VPN scenarios where private DNS servers are actually reachable.

This change removes the overly aggressive private IP filtering, now only filtering out localhost and link-local addresses. Private network DNS servers are allowed through since they may be reachable (e.g., via VPN or air-gapped networks). If they're actually unreachable, DNS will fail naturally, which is better than prematurely filtering them out.

Also downgraded the fallback warning from WARN to debug level since falling back to public DNS is a normal case, not an error condition.

Moving away from parsing DNS manually and letting libvirt handle networking would be cleaner long-term. This fix is a targeted solution for the immediate issue, but a future improvement could delegate more of the network configuration to the underlying infrastructure.

Assisted-by: Claude Code (Sonnet 4.5)

@gursewak1997 gursewak1997 marked this pull request as ready for review December 18, 2025 22:31
Copy link

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

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 modifies the DNS server filtering logic in crates/kit/src/run_ephemeral.rs. Previously, the system filtered out private network IP addresses (IPv4 private ranges and IPv6 ULA) from the list of host DNS servers. The changes now allow these private addresses, with updated comments explaining that this improves compatibility for VPN and air-gapped environments where such DNS servers might be reachable. Additionally, the log level for the fallback message when no usable DNS servers are found has been changed from warn to debug, and its accompanying comments have been refined to clarify the conditions and potential limitations of this fallback.

PR #167 introduced DNS filtering that excluded all private IP addresses
(10.x, 172.16-31.x, 192.168.x, fc00::/7) assuming they would be
unreachable from QEMU's slirp networking. However, this breaks VPN
scenarios where private DNS servers are actually reachable.

This change removes the overly aggressive private IP filtering, now
only filtering out localhost and link-local addresses. Private network
DNS servers are allowed through since they may be reachable (e.g., via
VPN or air-gapped networks). If they're actually unreachable, DNS will
fail naturally, which is better than prematurely filtering them out.

Also downgraded the fallback warning from WARN to debug level since
falling back to public DNS is a normal case, not an error condition.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: gursewak1997 <gursmangat@gmail.com>
@cgwalters cgwalters merged commit 8f8d301 into main Dec 19, 2025
7 checks passed
@gursewak1997 gursewak1997 deleted the fix-vpn-dns-filtering branch December 19, 2025 23:44
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