Know what each layer does
An IP address identifies an interface on a network. A route tells Linux where to send traffic, and a default route handles destinations without a more specific entry. DNS converts a name into addresses. Finally, an application must listen on the appropriate address and port. Each layer can fail independently.
The read-only checks below work on Ubuntu 24.04 LTS and AlmaLinux 9. Keep your SSH session open throughout. Do not restart networking or replace configuration files while diagnosing a remote server; a mistaken address or route can disconnect your session.
Inspect interfaces and routes
List the interfaces and their addresses. The loopback interface, lo, is used for communication inside the server. Other interface names vary by image, so do not assume your main interface is called eth0. Compare the assigned public address with the details supplied for your server.
List IPv4 and IPv6 routes separately. A destination lookup can show the selected interface, gateway, and source address without sending traffic. This is useful when more than one interface or routing path exists.
ip -brief address show
ip -4 route show
ip -6 route show
ip route get 1.1.1.1Test name resolution
Use getent to check how the operating system resolves a hostname. It follows the system's configured name-service rules, which may include local hosts entries as well as DNS. Repeated addresses with different socket types are normal. An empty result indicates that this lookup did not return a usable entry.
If an address-based connection works but a name-based connection fails, inspect name resolution before changing application settings. Successful name resolution alone does not prove that the remote service is reachable.
getent ahosts example.com
cat /etc/resolv.confIdentify listening services
The ss command can list listening TCP sockets numerically. Use sudo when you also need the owning process. An address of 127.0.0.1 limits a listener to the local machine; 0.0.0.0 means all IPv4 interfaces. IPv6 behavior depends on the address and the application's socket configuration.
A service can be running without listening on the expected public address. Conversely, a listener does not guarantee incoming traffic can pass local or provider firewalls. Check the application, its bind address, and the relevant access rules as separate steps.
sudo ss -lntpHandle persistent settings deliberately
Ubuntu Server commonly uses Netplan for persistent network configuration; AlmaLinux 9 normally uses NetworkManager. Provider images may supply these settings through cloud-init. Treat /etc/resolv.conf as a view of the current resolver configuration, since another service may generate it.
When requesting help, include the affected destination, exact error, interface state, and selected route. Share only relevant output and omit credentials. If configuration needs changing, first confirm console access and follow the instructions for your image and provider.
Official documentation
These upstream references provide more detail on the commands and workflows in this guide.