openziti / ziti-tunnel-sdk-c

Apache License 2.0
44 stars 17 forks source link

ziti-edge-tunnel shutdown DNS cleanup #536

Open johnalotoski opened 1 year ago

johnalotoski commented 1 year ago

Upon shutdown, ziti-edge-tunnel does not currently clean up the DNS nameserver resolver that it inserts into /etc/resolv.conf, either directly or via resolvconf for non systemd-resolved systems. This can result in degraded system performance due to slow failover to secondary dns servers when a primary dead resolver entry is left behind.

One example of simple systemd post service cleanup being done to work around this is: example.

I think it would be preferable to handle this within the app rather than systemd/packaging, as the binary will not always be run within the context of systemd or packaging, and if the solution is implemented at that level, then the problem will persist when not run in that context.

Discussed in https://openziti.discourse.group/t/misc-notes-after-a-few-days-of-working-with-ziti/826/3.

qrkourier commented 1 year ago

ZET shall remove its nameserver from /etc/resolv.conf if it's going to munge that file, which is dubious to begin with.