The Daemon Hang Vector
If you have manually edited a static IP configuration file in Ubuntu, or if the server suddenly loses its network connection despite the physical ethernet cable being perfectly secure, you cannot simply reboot the entire server. Rebooting a production web server causes catastrophic downtime for all hosted applications. You must surgically target and reboot only the specific software daemon responsible for handling network traffic.
How to Restart the Network Manager
Modern Ubuntu installations (version 16.04 and later) rely on `systemd` to manage background services. You must utilize the `systemctl` command to instruct the kernel to kill and resurrect the NetworkManager daemon.
1. Open your terminal application or connect to the server via SSH (if you still have localized network access).
2. Because restarting a core system daemon affects global connectivity, you must execute the command with superuser privileges.
3. Type the following command exactly as written:
sudo systemctl restart NetworkManager.service
(Note: Linux is strictly case-sensitive. The ‘N’ and ‘M’ in NetworkManager must be capitalized).
4. Press Enter.
5. The system will prompt you for your administrative password. Type it blindly and press Enter.
6. The Execution Reality: If the command is successful, the terminal will simply return a blank prompt. However, if you are connected via SSH, your terminal session will freeze for approximately three seconds. This is the exact moment the daemon dies and drops your connection, before instantly reviving and re-establishing the SSH tunnel. If your session does not freeze, the command failed.
7. Verification: To confirm the daemon is running with the new configuration, execute the status command:
sudo systemctl status NetworkManager.service
The terminal will output a block of text. Ensure the third line reads exactly `Active: active (running)` in bright green text.