Skip to content

[RFE] prevent DNS lookup on interface ("negative routing domains") #21260

Open

Description

@freedge

Is your feature request related to a problem? Please describe.
https://systemd.io/RESOLVED-VPNS/ describes a way to work with a corporate VPN, where some routing domains are specifically sent to a VPN interface. The use case is

Only specific domains should be resolved via the VPN’s DNS servers, and everything that is not related to the company’s domain names should go to regular, non-VPN DNS instead.

My problem is that VPN is not always up. When the VPN is down (and its interface is removed), the DNS queries that should have, and could only be, resolved when the VPN is up, are sent to public DNS instead, "leaking" the private company server names.

Describe the solution you'd like
I would like to have a way to "negate" a routing domain, something like ~. !~mycompany.com
that would mean, send everything to this interface except queries for this specific domain.

Describe alternatives you've considered
Right now I can live with my laptop sending DNS queries for mycompany.com on public internet...
I think there are solutions based on starting another DNS proxy like unbound or dnsmasq, but they seem overly complex for my problem.
Another possibility could be to play with some rules that would be triggered when the VPN is unplugged, and would add entries dynamically into /etc/hosts, and remove them when the VPN is plugged again...
Another possibility is to have a dummy "sinkhole" interface, with DNS domain set as ~mycompany.com, and DNS server set as 127.0.0.2. Resolutions of names belonging to mycompany.com will be sent to the sinkhole. When I am connected into the company's network, this interface must be shut down (using some rule or script)

The systemd version you checked that didn't have the feature you are asking for
per doc I don't think any systemd version has this feature.

thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁resolve

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions