During the system boot sequence or following an update to OpenVPN packages on Ubuntu Linux, administrators may encounter a striking error message in systemd logs: [FAILED] Failed to start Clean up any mess left by 0dns-down. This failure is tied to the service unit [email protected] or standalone resolvconf hooks designed to clean up temporary DNS resolver configurations left behind by ungraceful VPN disconnections. Resolving this systemd error cleans up boot warnings and ensures consistent network name resolution.
Understand the Purpose of the 0dns-down Cleanup Script
When connecting to an OpenVPN tunnel on Linux, client scripts dynamically modify /etc/resolv.conf to route DNS requests through the remote tunnel nameservers. When the tunnel terminates, a corresponding teardown script – commonly named 0dns-down – is called by resolvconf or NetworkManager to restore original interface resolvers. If an abrupt shutdown, crash, or missing dependency leaves this unit in an inconsistent state, systemd marks the unit as failed during boot.
Inspect Failed Unit Details and Journal Logs
To pinpoint the exact script path and reason for termination, examine systemd status and journal logs in a terminal:
- Check the status of the failing unit:
systemctl status "clean-up-any-mess-left-by-0dns-down.service" - If the exact unit name varies, list all failed systemd units on the machine:
systemctl list-units --failed - Query the systemd journal for relevant log messages:
journalctl -xeu "clean-up-any-mess-left-by-0dns-down" - Frequently, the log will show an exit status of
status=127(file or interpreter not found) orstatus=1/FAILUREindicating thatresolvconfor a referenced script path is missing.
Verify and Install Missing resolvconf Dependencies
The cleanup script relies on the resolvconf utility or systemd-resolved integration. If packages were partially upgraded or removed, the script fails due to absent binaries:
- Check whether resolvconf is installed:
which resolvconf - If the binary is missing and your network setup utilises legacy resolvconf hooks:
sudo apt update sudo apt install resolvconf - If your Ubuntu release uses modern
systemd-resolved(default in Ubuntu 20.04, 22.04, and 24.04), verify that the resolved service is active:systemctl status systemd-resolved - Ensure the
/etc/resolv.confsymlink points cleanly to systemd-resolved stub listener:sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Purge Obsolete OpenVPN Resolver Hooks
If you have uninstalled OpenVPN or switched to NetworkManager GUI connections, legacy sysvinit and systemd scripts may remain registered in system directories:
- Inspect
/etc/openvpn/update-systemd-resolvedor/etc/resolvconf/update.d/. - Check whether old cleanup files exist in
/etc/network/if-down.d/or/etc/network/if-post-down.d/. - If obsolete custom scripts reference
0dns-down, remove or archive the dangling hook:sudo rm -f /etc/network/if-down.d/0dns-down sudo rm -f /etc/network/if-post-down.d/0dns-down - Reload the systemd daemon to unregister obsolete references:
sudo systemctl daemon-reload
Disable or Mask the Errant Service Unit
If the error is generated by an orphaned systemd wrapper unit that provides no functional utility on your current network configuration, masking it prevents systemd from invoking it during boot:
- Reset the failed state in systemd:
sudo systemctl reset-failed - Disable and mask the cleanup unit:
sudo systemctl stop clean-up-any-mess-left-by-0dns-down.service sudo systemctl mask clean-up-any-mess-left-by-0dns-down.service - Reboot the system to confirm a clean startup sequence without red failure notices:
sudo reboot