How to Fix Failed to Start Clean Up Any Mess Left by 0dns Down in Ubuntu

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:

  1. Check the status of the failing unit:
    systemctl status "clean-up-any-mess-left-by-0dns-down.service"
  2. If the exact unit name varies, list all failed systemd units on the machine:
    systemctl list-units --failed
  3. Query the systemd journal for relevant log messages:
    journalctl -xeu "clean-up-any-mess-left-by-0dns-down"
  4. Frequently, the log will show an exit status of status=127 (file or interpreter not found) or status=1/FAILURE indicating that resolvconf or 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:

  1. Check whether resolvconf is installed:
    which resolvconf
  2. If the binary is missing and your network setup utilises legacy resolvconf hooks:
    sudo apt update
    sudo apt install resolvconf
  3. 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
  4. Ensure the /etc/resolv.conf symlink 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:

  1. Inspect /etc/openvpn/update-systemd-resolved or /etc/resolvconf/update.d/.
  2. Check whether old cleanup files exist in /etc/network/if-down.d/ or /etc/network/if-post-down.d/.
  3. 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
  4. 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:

  1. Reset the failed state in systemd:
    sudo systemctl reset-failed
  2. 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
  3. Reboot the system to confirm a clean startup sequence without red failure notices:
    sudo reboot

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.