On Fri 03 Mar 2023 at 22:00:37 (+0700), Max Nikulin wrote:
> On 03/03/2023 13:29, Tim Woodall wrote:
> > On Fri, 3 Mar 2023, Max Nikulin wrote:
> > > 
> > > dhclient running for enp2s0f0 should detect that VPN is active
> > > and to avoid overwriting DNS settings that direct requests to
> > > tun0.
> > > 
> > The hook can create and delete a file like rhis:
> > tim@dirac:/etc/dhcp (none)$ cat dhclient-enter-hooks.d/nodnsupdate
> > make_resolv_conf() {
> >          :
> > }
> 
> I agree that VPN script may add and remove dhclient hook or may write
> some file in /run that is read by dhclient hook. They should cooperate
> in some way. In more versatile configuration domain resolution may be
> per-interface. E.g. hosts from the corporate domain are resolved
> through tun0, other sites through enp2s0f0.

This is the job that packages like openresolv are designed
to do. BTW if you look up that package in apt's lists, note
that this is a case where you need man's section number, because
man 8 resolvconf   without the 8 will give you a systemd page.

Cheers,
David.

Reply via email to