Menu
Coddy logo textTech

IP Addresses

Lesson 3 of 47 in Coddy's Networking with the Terminal course.

For a request to arrive, the client needs the server's address. On a network that address is an IP address, and the familiar form looks like 93.184.216.34: four numbers, each from 0 to 255, separated by dots. That is IPv4.

There are not enough of those to go around any more, so there is also IPv6, which is longer and written in hex, like 2606:2800:220:1:248:1893:25c8:1946. You will meet both, and the ideas in this course apply to each.

One address matters more than any other while you are learning: 127.0.0.1, which always means this machine, right here. It has a name too, localhost. A request to it never leaves the computer, which makes it perfect for practising: you can run the server and the client side by side and watch both ends.

That is exactly what you will do for the rest of this course.

challenge icon

Challenge

Medium

Read an address straight out of a command's output.

When ping starts it announces the address it is talking to, on its first line:

PING 127.0.0.1 (127.0.0.1): 56 data bytes

Ping 127.0.0.1 once and print only the address, the second word of that first line:

127.0.0.1

head -1 keeps the first line, and awk can print a single column of it.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Networking with the Terminal

Practice on your own: Terminal playground