Examining system health with systemctl --failed on an Ubuntu server or workstation frequently highlights a degraded unit: 0dns-clean.service: Failed with result 'exit-code' or Failed to start Clean up any mess left by 0dns-down to resolvconf. Although networking often functions normally, this recurring service failure clutters boot diagnostics and indicates broken legacy DNS integration scripts.
Why Does 0dns-clean.service Fail in Ubuntu?
The 0dns-clean service is an obsolete cleanup script originally bundled with PPP (Point-to-Point Protocol) and legacy dialup/VPN networking packages:
- Missing Legacy resolvconf Binary: The script attempts to invoke
resolvconfto flush old DNS configurations, but modern Ubuntu usessystemd-resolvedinstead, meaning the binary is absent. - Orphaned PPP Dialup Configuration Packages: Leftover configuration hooks from
pppor legacy PPPoE network packages that persist after package updates. - Missing /etc/ppp/resolv Directory: The cleanup script expects legacy directories that do not exist on modern systemd installations.
- Exit Code 1 on Empty Cleanup Queues: The helper script returning a non-zero exit code when no legacy files are found to delete, triggering a false-positive systemd failure.
1. Review systemd Journal Logs for 0dns-clean
Inspect the exact script command that triggered the failure.
sudo systemctl status 0dns-clean.service
To inspect detailed command output:
sudo journalctl -u 0dns-clean.service -b --no-pager
Common messages include /etc/ppp/ip-down.d/0dns-down: line 12: resolvconf: command not found or No such file or directory.
2. Purge Legacy PPP Packages (If Unused)
If your Ubuntu installation connects via standard Ethernet, Wi-Fi, or modern Netplan rather than legacy dialup PPPoE modems, removing orphaned PPP packages eliminates the script.
- Check if PPP packages are installed:
dpkg -l | grep -E "ppp|resolvconf" - If PPPoE is not required for your internet connection, purge the orphaned package:
sudo apt purge ppp - Remove orphaned configuration files left behind:
sudo rm -f /etc/ppp/ip-down.d/0dns-down sudo rm -f /etc/ppp/ip-up.d/0dns-up
3. Mask the 0dns-clean.service Unit
If PPP is required for custom VPNs but the legacy DNS cleanup script is incompatible with systemd-resolved, masking the service prevents it from running.
sudo systemctl stop 0dns-clean.service
sudo systemctl disable 0dns-clean.service
sudo systemctl mask 0dns-clean.service
Masking links the unit file to /dev/null, permanently preventing systemd from attempting to execute the failing script during boot.
4. Confirm Zero Failed Services in Ubuntu
Verify that your systemd runtime environment is completely healthy.
sudo systemctl reset-failed
systemctl --failed
Confirm that the output reads 0 loaded units listed. DNS resolution and system startup will proceed cleanly without errors.