The words: IP, DNS, domain, port, firewall
IP, DNS, port, firewall: these words feel scary because you hear them without ever seeing them. Here, you see them: five simple pictures, seven commands, and none of these words will trip you up again.
- Course
- Tutorial 4 of 35
- Time
- 20 min to read
- Tested with
- Debian 13.7 (trixie); iproute2 6.15.0, curl 8.14.1, dig 9.20.30
What you will be able to do
- Explain in one sentence: IP address, domain, DNS, port, firewall.
- Follow a web request from the domain to the server.
- Display a machine's IP address, open ports and DNS answer.
- Test whether a site answers, using curl.
Before you start: VPS or dedicated server: which one to pick?.
Contents

The problem: a name typed, a page received
When you type example.org into a browser, a page shows up within a second. Your browser sent a request, a polite "please send me this page" addressed to a server. Yet you didn't type a single number, even though machines on the Internet find each other by numbers. Five things work quietly between your keyboard and the server:
- an IP address;
- a domain name;
- a DNS;
- a port;
- a firewall.
Three of these words already came up in the previous article, VPS or dedicated server: which one to pick? (IP address, port, firewall).
Let's reuse that article's picture: a VPS is a flat, a dedicated server is a house, and each has its own IP address. We'll follow the page's path one word at a time. Where does the machine live? How do we find it by name? Which door do we knock on? Who guards the entrance? Each word gets its picture and its command. But first, we need to set the stage.
Before you start
The commands in this article only read information, except for installing four small tools. A command is a line of text typed into a terminal, the window where you run a machine by typing. You can try them on any Debian computer, or on your rented server. Its remote console (the emergency screen your hosting provider shows on its website, available with both kinds of plan, depending on the provider) gives you a terminal. With no server yet, just read the outputs. Install Debian 13 on a VPS or a dedicated server will get you one.
The next command installs four packages, which are ready-to-install programs. It needs administrator rights. If you are root (the all-powerful user), type it as it is. Otherwise, put sudo in front: it's the command that lends you administrator rights. For the details, see Users, sudo and file permissions.
apt-get install -y iproute2 curl bind9-dnsutils ca-certificatesEach package has a job:
iproute2brings theipandsscommands;curlknows how to talk to a website;bind9-dnsutilsbringsdig, which queries the DNS;ca-certificateslets curl check encrypted sites, the ones whose traffic is scrambled so that only the recipient can read it.
The tools are ready. Let's start with the first question: where does a machine live?

1The IP address: a machine's postal address
An IP address is the number that identifies a machine on a network, the way a postal address identifies a home. It comes in two formats that live side by side.
- IPv4: four numbers from 0 to 255 separated by dots, for example
203.0.113.10. This address is reserved for examples. It points to no real machine, and yours will be different. - IPv6: a longer format, with digits, letters and colons, created because IPv4 addresses are running out.
An address is also public or private:
- A public address can be reached from the whole Internet. That is the address of your rented server.
- A private address only works inside a local network, like the one behind your home router, the box your Internet provider gave you.
Private addresses most often start with 10. or 192.168..
To see the machine's addresses, type the next command. An option is a setting added after the command. Here, -br ("brief") gives one line per network connection.
ip -br addrlo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 203.0.113.10/24Two lines. The first, lo, is the machine talking to itself: 127.0.0.1 means "me". The second, eth0, is the real connection, with the example address. That is the machine's number. But nobody wants to memorize a number, so we need to call the machine by name.
2The domain and the DNS: the name and the phone book
A domain name is a readable name, like example.org, that replaces the IP address in everyday life. It is the name on the shop sign: easier to remember than the street number. But machines only understand numbers. The DNS (domain name system) sits between the two: it's the phone book that turns a name into an IP address. On every visit, your browser asks it "what is the address of example.org?", and the DNS answers with a number.
Let's see what that looks like. Take example.org, the example domain we already used. The dig command queries the DNS, and the +short option prints only the answer.
dig +short example.org172.66.157.237
104.20.26.136The DNS answered with two IPv4 addresses. One name can lead to several addresses, which is common for big sites, and their order changes from one try to the next. Your addresses may differ. If dig prints nothing, jump to the "If it fails" section. We can now find the right machine. But it runs several services, so we still have to pick the right door.
3The port: the doors of a home
An IP address points to a whole home, but that home holds several services. A port is a door number: each service listens behind its own door, and there are 65,535 of them per address. Don't confuse it with the connection speed (in Gbit/s) from VPS or dedicated server: which one to pick?. Here, "port" always means port number.
Three doors are worth knowing. The table sums them up.
| Port | Service |
|---|---|
| 22 | SSH: running the server remotely |
| 80 | HTTP: the unencrypted web |
| 443 | HTTPS: the encrypted web |
To list the doors with someone listening behind them, use ss -tln. Its options ask for the services waiting for visitors, with their port numbers.
ss -tlnState Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*Two lines, for the same service. SSH listens on port 22, first over IPv4 (0.0.0.0 means "all addresses"), then over IPv6 ([::]). On your machine, the list depends on what is running. If it is empty, nobody is listening yet. But a listening door is not necessarily open to everyone, because someone can guard it.
4The firewall: the guard at the entrance
A firewall is a guard posted in front of the home's doors. It lets traffic through or blocks it, based on the port number. When someone knocks on a blocked door, it can react in two ways:
- it can reject the caller: an immediate "no";
- it can ignore the caller: no answer, and the caller waits.
We won't install a firewall here. We'll just watch both reactions at a closed door. For that, curl plays the browser from the terminal, with three options.
| Option | Role |
|---|---|
-s | Turns off the progress messages |
-I | Asks only for the header of the reply, its first lines of information |
-m 5 | Gives up after five seconds |
Every program also leaves a small number behind when it finishes: the exit code. It is 0 if all went well, and something else if not. The ; echo "code de sortie : $?" part prints it after curl (the French words mean "exit code").
Let's ask curl to knock on port 81 of your own machine, where nobody is listening.
curl -sI -m 5 http://localhost:81 ; echo "code de sortie : $?"code de sortie : 7The answer is instant, with code 7: the connection is refused. That is the immediate "no". A firewall that rejects would give the same result. Now let's knock on door 81 of someone else's site, example.org.
curl -sI -m 5 https://example.org:81 ; echo "code de sortie : $?"code de sortie : 28Silence for five seconds, then code 28, which means "timed out". You have seen both reactions: the immediate "no", and the silent wait, just like a firewall that ignores you. This test proves nothing about the firewall on the other side, or about yours.
Each word now has its place. Time to watch them work together, from the start to the end of one request.
5A request from start to finish
When you open a site, four steps put the five words to work. First comes the domain you type, then the DNS that gives the IP address, then the firewall that lets port 443 through, and finally the server that answers. The diagram below shows that trip to example.org.
Let's redo that trip by hand with curl and its -s and -I options, which you already know. The | sign sends the output of the first command into the second, here head -n 3, which keeps only the first three lines.
curl -sI https://example.org | head -n 3HTTP/2 200
date: Wed, 04 Nov 2026 22:53:40 GMT
content-type: text/html; charset=utf-8The first line matters. HTTP is the language that browsers and sites use to talk, and code 200 means "all good". The DNS found the address, door 443 was open, and the server answered. The date changes on every try. Here is the whole picture in one table.
The five words at a glance
| Word | Picture | Command |
|---|---|---|
| IP address | The home's postal address | ip -br addr |
| Domain | The name on the shop sign | None: it is the name you type |
| DNS | The phone book of addresses | dig +short example.org |
| Port | The door number | ss -tln |
| Firewall | The guard at the entrance | curl -sI -m 5 http://localhost:81 (instant refusal) and curl -sI -m 5 https://example.org:81 (silence) |
If it fails
If one of these tests doesn't give the expected output, here are the three most common errors.
dig +shortprints nothing and gives your prompt back. The name does not exist, or the DNS is not answering. Check the spelling: with an invented name likenexiste-pas.example.org, the reply is empty, with no error message.curlprintscurl: (6) Could not resolve host(without the-soption), or exit code 6 with it. curl couldn't find the address for that name, for the same reason as above. Code 28 means the address was found but nobody answers on that port.dig: command not found: thebind9-dnsutilspackage is missing. Install it with the command from the "Before you start" section.
You now have the words to understand a connection. To run a server remotely, you need to know how to connect to it, and that is the subject of What is SSH?.