Skip to main content

Common networking tasks

Changing your VPS hostname

Setting a descriptive hostname helps identify your server on the network. To change it:

  • Edit /etc/hostname with your desired name: sudo nano /etc/hostname
  • Update /etc/hosts to map the new hostname to 127.0.1.1:
127.0.0.1    localhost
127.0.1.1    my-vps.example.com my-vps
  • Apply the change with sudo hostnamectl set-hostname my-vps.example.com and log out/in.

Checking network connectivity

If you experience connectivity issues, these commands can help diagnose problems:

  • ping 8.8.8.8 – verify the VPS can reach the internet.
  • ping your-server – test if a remote host is reachable.
  • traceroute example.com (install via apt install traceroute) – see the path packets take.
  • ip addr or ip a – view assigned IP addresses and interface status.
  • ip route – check default gateway and routing table.

Restarting network services

After making changes to network settings (for example, adding an IP address or updating DNS), you may need to restart the networking service:

  • On systems using systemd-networkd: sudo systemctl restart systemd-networkd.
  • On Ubuntu/Debian with netplan: apply changes with sudo netplan apply.
  • On CentOS/AlmaLinux with NetworkManager: sudo systemctl restart NetworkManager or reload a connection with nmcli connection reload.

Adding an additional IP address

If you have purchased an extra IP, you can assign it without rebooting:

  • Identify your network interface (usually eth0 or ens18) with ip link.
  • Add the IP temporarily using: sudo ip addr add 203.0.113.2/32 dev eth0.
  • To make the address persistent, edit your network configuration file (e.g., /etc/netplan/*.yaml or /etc/sysconfig/network-scripts/ifcfg-eth0) and add the new IP details, then restart networking.
  • Update your DNS A record to point the new IP if it will be used for websites or services.

Running a speed test

To gauge your VPS’s network performance:

  • Install iperf3 on both client and server to measure throughput: sudo apt install iperf3; run iperf3 -s on a remote server and iperf3 -c server_ip from your VPS.
  • For a quick test against a public service, install speedtest-cli (pip install speedtest-cli) and run speedtest.

Changing DNS resolvers

If your VPS cannot resolve domain names, change your DNS servers:

  • Edit /etc/resolv.conf and add nameservers:
nameserver 1.1.1.1
nameserver 8.8.8.8
  • On systems using systemd-resolved, create or edit /etc/systemd/resolved.conf, set DNS=1.1.1.1 8.8.8.8, then run sudo systemctl restart systemd-resolved.

For help with advanced networking (GRE tunnels, BGP sessions, etc.), please open a support ticket.