Learning Objectives
By the end of this chapter, you will be able to:
- Define an IP address and its purpose.
- Differentiate between IPv4 and IPv6.
- Distinguish public and private, static and dynamic IP addresses.
- Define the Domain Name System (DNS) and explain its function.
- Identify the parts of a domain name and a URL.
Internet Addresses: IP Addresses
Every device connected to the internet is assigned a unique identifying number called an Internet Protocol (IP) address. This address works like a street address, allowing data to be routed to the correct destination.
There are two versions of IP addresses:
-
IPv4: The original version. It consists of four numbers separated by periods (e.g.,
192.168.1.1). IPv4 can support about 4.3 billion unique addresses. -
IPv6: A newer version created because the world was running out of IPv4 addresses. It uses a much longer format and can support a virtually limitless number of addresses.
| Aspect | IPv4 | IPv6 |
|---|---|---|
| Length | 32 bits | 128 bits |
| Format | Four decimal numbers (0–255) with dots | Eight groups of hexadecimal digits with colons |
| Example | 202.70.64.10 |
2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Number of addresses | About 4.3 billion (2³²) | About 3.4 × 10³⁸ (2¹²⁸) |
| Status | Still most widely used | Growing; needed for mobile and IoT devices |
Each IPv4 number is between 0 and 255 because it is stored in 8 bits, so 256.1.1.1 is not a valid address.
Types of IP addresses
- Public IP — reachable on the internet and assigned by your ISP (for example, the address of a website’s server).
- Private IP — used inside a home or office network and not reachable directly from the internet, such as
192.168.x.xor10.x.x.x. The router shares one public IP among many private devices using NAT. - Static IP — fixed and does not change; used for servers, websites, and CCTV access.
- Dynamic IP — assigned automatically by a DHCP server and may change each time you connect; used for most home users and phones.
The Domain Name System (DNS)
While computers use numerical IP addresses to identify each other, humans find it much easier to remember names. The Domain Name System (DNS) is the internet’s phonebook. It is a global system that translates human-readable domain names (like www.google.com) into their corresponding numerical IP addresses that computers use.
When you type a domain name into your web browser:
- Your computer sends a request to a DNS server.
- The DNS server looks up the domain name in its database and finds the corresponding IP address.
- It sends the IP address back to your computer.
- Your computer then uses that IP address to connect to the web server for the site you want to visit.
sequenceDiagram
participant B as Browser
participant D as DNS server
participant W as Web server
B->>D: What is the IP of www.example.com.np?
D-->>B: It is 203.0.113.25
B->>W: Request page from 203.0.113.25
W-->>B: Web page
To save time, computers and DNS servers cache recent answers, so a popular site does not need a fresh lookup every time.
Parts of a domain name
Domain names are read from right to left:
- Top-level domain (TLD):
.com,.org,.edu, or country codes such as.npfor Nepal. - Second-level domain: the registered name, such as
googleingoogle.com, orcomin.com.np. - Subdomain: a prefix such as
wwwormail.
For www.arjankc.com.np: .np is the country TLD, com.np is the commercial category, arjankc is the registered name, and www is the subdomain.
Domain name vs URL
A URL (Uniform Resource Locator) is the full address of a resource, of which the domain name is only one part:
https://www.example.com.np/products/index.html
https— protocolwww.example.com.np— domain name/products/index.html— path to the specific page
Nepal Context
.np domains are managed by Mercantile Communications on behalf of Nepal, and .com.np domains for individuals and businesses have traditionally been registered free of charge with supporting documents. Nepali ISPs such as Nepal Telecom and WorldLink assign IP addresses to customers and run their own DNS servers; many ISPs are also rolling out IPv6.
Summary
Every device on the internet has a unique numerical IP address to identify it. IPv4 uses 32-bit addresses and is running out, so the 128-bit IPv6 was introduced. Addresses can be public or private, static or dynamic. Because these numbers are hard for humans to remember, the Domain Name System (DNS) acts as a global directory, translating the easy-to-remember domain names that we use (like www.google.com) into the IP addresses that computers need to communicate. Domain names have a TLD, a second-level domain, and subdomains, and they form one part of a full URL.
Key Takeaways
- An IP address is a unique numerical label for a device on the internet.
- IPv4 is 32-bit; IPv6 is 128-bit.
- Private IPs are used inside networks; public IPs are reachable on the internet.
- DNS translates domain names into IP addresses.
- IPv6 was created to solve the problem of running out of IPv4 addresses.
Discussion Questions
- Using the phonebook analogy, explain the role of DNS.
- Why was it necessary to create IPv6?
- What do you think would happen to the internet if the DNS system suddenly stopped working?
Exam-Style Questions
Short answer
- What is an IP address? Is
300.12.5.1a valid IPv4 address? Why? - Differentiate between static and dynamic IP addresses.
- Identify the protocol, domain name, and path in
https://www.nepal.gov.np/about.html.
Long answer
- Compare IPv4 and IPv6. Why is the world moving to IPv6?
- What is DNS? Explain step by step what happens when you type a website address into a browser.

