Uninstalling DNClient Server
This guide describes how to uninstall the dnclient binary and all associated config files on a machine.
Linux
Package installations
If you installed dnclient from a package, remove it with your package manager. On APT and RPM, removing the package stops the service.
If you enabled any named instances, disable each one first so its systemd symlinks don't outlive the package:
sudo systemctl disable --now dnclient@newNetwork
- APT
- RPM
- Arch (AUR)
# Remove the package, keeping enrollment state in /var/lib/defined
sudo apt-get remove dnclient
# Or purge, which also deletes /var/lib/defined and /etc/default/dnclient
sudo apt-get purge dnclient
Any environment file you created for a named instance belongs to you rather than the package, so even a purge leaves it behind:
sudo rm -f /etc/default/dnclient.newNetwork
To stop receiving updates, also remove the repository definition:
sudo rm /etc/apt/sources.list.d/defined-net.list /etc/apt/keyrings/defined-net.asc
sudo dnf remove dnclient
# Removal leaves enrollment state behind; delete it if you're done with the host
sudo rm -r /var/lib/defined
If you edited /etc/sysconfig/dnclient, rpm preserves your copy as /etc/sysconfig/dnclient.rpmsave. Any environment file you created for a named instance isn't owned by the package and is left in place:
sudo rm -f /etc/sysconfig/dnclient.rpmsave /etc/sysconfig/dnclient.newNetwork
To stop receiving updates, also remove the repository definition:
sudo rm /etc/yum.repos.d/defined-net.repo
# pacman doesn't stop services on removal, so disable it first
sudo systemctl disable --now dnclient
# -n deletes /etc/conf.d/dnclient rather than keeping it as a .pacsave file
sudo pacman -Rns dnclient
# Removal leaves enrollment state behind; delete it if you're done with the host
sudo rm -r /var/lib/defined
Any environment file you created for a named instance isn't tracked by pacman:
sudo rm -f /etc/conf.d/dnclient.newNetwork
Standalone binary installations
sudo dnclient stop
sudo dnclient uninstall
rm $(which dnclient)
# To remove state files:
sudo rm -r /var/lib/defined/
# service managers like systemd will auto-delete logs
DNClient 0.9.4 moved the Linux state directory from /etc/defined to /var/lib/defined. A host that enrolled before 0.9.4 and upgraded in place keeps using /etc/defined, because DNClient falls back to the old directory when the new one holds no enrolled networks. This applies to package installations too, if the host first enrolled under an older standalone binary. Check both locations, and remove /etc/defined/ too if it's still there.
macOS
sudo dnclient stop
sudo dnclient uninstall
rm $(which dnclient)
# To remove config / log files:
sudo rm /etc/defined/config.yml /etc/defined/dnclient.yml
sudo rm -r /etc/defined/
sudo rm /usr/local/var/log/dnclient.*.log
Windows
On Windows you have two choices:
- Find the app (
Defined Networking ClientorDNClient Serverdepending on the version) in "Add or remove programs" in Control Panel and delete the application. This will delete the app and remove all associated config files. - Download the installer again from https://admin.defined.net/downloads, and use the built-in uninstaller.
Both uninstall methods will remove the installation directory, which contains the config files for any enrolled networks.