EMZETT.
Login

Networking on Linux: ip, NetworkManager and DNS

In short: On Linux the network is configured with the ip command and a management service (NetworkManager or systemd-networkd). DNS resolution is usually handled by systemd-resolved.

In more detail: On the desktop NetworkManager with a graphical interface is enough. Servers often use systemd-networkd, Netplan (Ubuntu) or configuration files.

In detail

ip a                   # interface addresses
ip r                   # routes (default gateway)
ip link set eth0 up
ping -c3 1.1.1.1
ss -tulpn              # open ports and processes
nmcli device status    # NetworkManager
nmcli dev wifi connect "SSID" password "secret"
resolvectl status      # DNS settings
dig example.org        # DNS query
  • Interfaces: eth0/enp3s0 (cable), wlan0/wlp2s0 (Wi-Fi), lo (local), docker0, br0 (bridge).
  • DHCP or static: mostly automatic via DHCP.
  • Configuration: /etc/NetworkManager/, /etc/netplan/, /etc/systemd/network/.
  • DNS files: /etc/hosts (local names), /etc/resolv.conf.
  • Tools: traceroute, mtr, curl, nmap, tcpdump, wireshark.
  • Outdated: ifconfig, netstat, route (replaced by ip and ss).

See also: Firewall on Linux: nftables, ufw and firewalld, SSH on Linux: keys and hardening