Knowing the IP address of your Debian server is essential for managing and troubleshooting your network. Whether you’re setting up a web server, SSH access, or simply monitoring connectivity, here are the steps to find your server’s IP address.
1. Using the ip
Command
The ip
command is the most modern and commonly used tool to retrieve IP address information. Run the following command:
ip addr show

Look for the section corresponding to your network interface (e.g., eth0
, ens33
, or wlan0
). The IP address will be listed under the inet
field. For example:
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic ens33

Here, the IP address is 192.168.1.100
.
2. Using the ifconfig
Command
The ifconfig
command is a traditional method for viewing network configurations. Although it’s deprecated in newer Debian versions, you can still install and use it:
sudo apt install net-tools
ifconfig

The IP address will be listed next to the inet
field under the relevant network interface.
3. Using hostname -I
For a quick and simple way to view the IP address, use:
hostname -I

This will display your server’s IP address(es) in a single line, separated by spaces.
4. Viewing Network Configuration Files
You can also check the IP address by viewing network configuration files, especially if your server uses static IP settings:
cat /etc/network/interfaces

Look for lines starting with address
, which will indicate the IP address.
0 Comments