Home Linux BasicsLinux Networking Basics: IP Address, ping, curl and DNS in Plain English

Linux Networking Basics: IP Address, ping, curl and DNS in Plain English

by Knowledge Base Linux
Linux networking basics: two computers connected across a small globe

Every time your Linux computer loads a web page, sends a message or downloads an update, it is having a conversation with another computer somewhere in the world. Linux networking basics is simply the art of understanding those conversations: how computers find each other, how they check that the other side is alive, and how names like example.com turn into numbers. No maths degree required — just a few friendly ideas and three commands: ip, ping and curl.

Linux Networking Basics: What Is an IP Address?

An IP address is your computer’s address on a network, written as four numbers separated by dots, like 192.168.1.10. Just as a letter needs a house address, data traveling across a network needs an IP address to know where to go.

There are two kinds you will meet. A private address (usually starting with 192.168. or 10.) works inside your home or office network; your router hands these out. A public address is the one your router shows to the whole internet. One special address deserves a name badge: 127.0.0.1, called localhost, always means “this very computer” — programs use it to talk to themselves.

To see your own addresses, run:

ip addr show

Look for a line starting with inet under your network interface (often named eth0 for wired or wlan0 for Wi-Fi). The number after inet is you, on that network.

Linux Networking Basics: ping, the “Are You There?” Command

The ping command sends a tiny “are you there?” message to another computer and times how long the reply takes:

ping -c 4 example.com

The -c 4 part asks for exactly four pings; without it, ping continues until you stop it with Ctrl + C. Each reply line shows a time in milliseconds — smaller is closer and faster. If you see “Name or service not known”, your computer could not even look up the address. If you see replies, the other machine is reachable and the network path works.

Ping is the first tool to reach for when something feels broken. Can you ping your router (often 192.168.1.1) but not example.com? Then your local network is fine and the problem is further away, possibly with names — which brings us to DNS below. One caution: some servers are configured to ignore pings, so silence does not always mean the server is down.

Linux networking basics: a penguin postman delivering messages between houses

curl: Talking to Websites from the Terminal

While ping checks whether a computer answers at all, curl actually has a conversation with a website. The simplest useful form asks only for the response headers — the website’s opening greeting:

curl -I https://example.com

The very first line is the famous status code. 200 means OK. 301 or 302 means “moved, go over there”. 404 means the page was not found, and anything starting with 5 means the server itself has a problem. Without -I, curl downloads and prints the whole page as raw HTML — fascinating once, messy after that. To save a file instead, add -O before a file URL. System administrators lean on curl constantly; once you are comfortable, tools like the ones in our guide to monitoring network bandwidth with vnStat build naturally on these same basics.

DNS in Plain English: The Internet’s Phone Book

Computers route data using IP addresses, but humans remember names like example.com. DNS (Domain Name System) is the internet’s phone book: it looks up a name and returns the number. When you ping or curl a name, your computer quietly asks a DNS server for the address first, then starts the real conversation.

You can do that lookup yourself with:

nslookup example.com

If nslookup finds an address but your browser still fails, DNS is innocent and the problem lives elsewhere. If nslookup fails while your connection works for other sites, the name itself may not exist or its DNS records may be broken. Knowing this one distinction — names versus numbers — solves half of all beginner networking confusion.

Common Beginner Mistakes

  • Assuming no ping reply means the server is down. Many servers block ping on purpose. Follow up with curl -I before concluding anything.
  • Mixing up private and public addresses. Your 192.168.x.x address only works inside your local network; friends on the internet cannot reach it directly.
  • Forgetting to stop ping. Without -c, ping runs forever. Ctrl + C stops it and prints a summary.
  • Downloading huge files with plain curl. Running curl on a page URL prints everything to your screen. Use -I to check first, and -O only when you truly want the file.
  • Blaming the website for a DNS problem. If every site fails by name but works by IP address, your DNS settings are the suspect, not the websites.

Conclusion

Linux networking basics really are just three ideas: every computer has an IP address, ping checks that another computer answers, and DNS translates friendly names into numbers — with curl letting you greet websites directly and read their status codes. Practice with ip addr show, ping your router, then curl a favorite site, and the network stops being mysterious. For a gentle next step, MDN’s beginner explainer on how the internet works is an excellent read.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.