Computer IP Address and DNS

Every device on a network needs an address, and every website needs a name people can remember. The IP address handles the first job, and the Domain Name System (DNS) handles the second. A home address lets the postal worker find your door. A phone book lets you look up a friend's address by name. Computers use the same two ideas.

What Is an IP Address

An Internet Protocol (IP) address is a unique number that identifies a device on a network. Data packets carry the sender address and the receiver address, so routers know where to deliver them.

IPv4 Addresses

IPv4 uses four numbers separated by dots. Each number ranges from 0 to 255 because it occupies 8 bits.

192  .  168  .  1   .  25
 │       │      │      │
8 bits  8 bits 8 bits 8 bits   = 32 bits in total

Binary of 192 → 11000000

The 32-bit design offers about 4.3 billion addresses. The growth of phones, laptops, and smart devices consumed most of them.

IPv6 Addresses

IPv6 uses 128 bits and writes addresses in hexadecimal groups.

2001:0db8:85a3:0000:0000:8a2e:0370:7334

The supply of IPv6 addresses is practically endless. Providers and websites continue to adopt it alongside IPv4.

Public and Private Addresses

A public address works across the internet, and your provider assigns it to your home connection. Private addresses work only inside a local network. Many homes reuse the same private ranges without conflict because routers keep them hidden from the outside.

Private Ranges
10.0.0.0      – 10.255.255.255
172.16.0.0    – 172.31.255.255
192.168.0.0   – 192.168.255.255

Home Network
Internet ◄──► Router (public IP: one address)
                 ├── Phone    192.168.1.10
                 ├── Laptop   192.168.1.11
                 └── TV       192.168.1.12

Static and Dynamic Addresses

  • Static: The address stays fixed. Servers and network printers often use it.
  • Dynamic: The address changes over time. Most home devices use it.

DHCP, the Dynamic Host Configuration Protocol, hands out dynamic addresses automatically. When your phone joins Wi-Fi, the router assigns it a free address from its pool within seconds.

What Is DNS

Computers locate websites through IP addresses, but people prefer names such as example.com. DNS translates the name into the number. The whole system works like a giant, shared phone book spread across thousands of servers worldwide.

Parts of a Domain Name

www . example . com
 │       │       │
 │       │       └─ Top-level domain (TLD)
 │       └───────── Domain name
 └───────────────── Subdomain

How a DNS Lookup Works

Typing a website name triggers a quick chain of questions.

You type: www.example.com
   │
   ▼
Browser cache → knows it? ── yes ─► Use the saved address
   │ no
   ▼
Resolver (from your provider) → knows it? ── yes ─► Return address
   │ no
   ▼
Root server  → "Ask the .com server"
   ▼
TLD server   → "Ask the example.com server"
   ▼
Authoritative server → "The address is 93.184.216.34"
   ▼
Browser connects to that address and loads the page

The entire process finishes in milliseconds. Each server along the way saves the answer for a short time, called caching, so repeated visits load faster.

Useful Checks

  • Run ipconfig on Windows or ip addr on Linux to view your local address.
  • Run nslookup example.com to see the address behind a name.
  • Switching to a different DNS service sometimes fixes slow or failing page loads.

Ports: Finding the Right Program

An IP address finds the device, and a port number finds the program on that device. Picture an apartment building. The IP address names the building, and the port names the apartment. Web servers listen on port 80 for plain connections and port 443 for secure ones. Email and file services use other numbers.

Request → 93.184.216.34 : 443
          └─ building ─┘   └─ apartment (secure web service)

Subnet Mask

A subnet mask tells a device which part of an address names the network and which part names the device. The common mask 255.255.255.0 means the leading three numbers identify the network, and the last number identifies the device. Devices that share the same network part talk directly. Traffic bound for other networks travels through the router.

Key Takeaways

  • An IP address identifies a device, much like a home address identifies a house.
  • IPv4 uses 32 bits, and IPv6 uses 128 bits.
  • Routers hide private addresses behind one public address.
  • DNS converts website names into IP addresses.