Domain, Hosting, IP Address & DNS
When you visit a website, you usually type a simple address such as:
example.com
But computers communicate across networks using IP addresses, not just human-friendly domain names.
So how does a browser know which server contains the website?
This is where Domain, Hosting, IP Address, and DNS work together.
A simplified flow is:
Domain → DNS → IP Address → Hosting Server → Website
Understanding this process is essential for web developers because almost every live website depends on these components.
What Is a Domain Name?
A domain name is a human-readable name used to identify and access a website.
Examples:
google.com
wikipedia.org
example.com
Without domain names, users would often need to work with numerical or hexadecimal IP addresses to identify network destinations.
Instead of remembering an address such as:
93.184.216.34
it is much easier to remember:
example.com
In simple terms:
Domain Name = Human-Friendly Website Address
Parts of a Domain Name
Consider:
www.example.com
It can be divided into several parts.
www
This is a subdomain.
example
This is the main registered domain label.
.com
This is the Top-Level Domain (TLD).
Other common TLDs include:
.org.net.edu.gov.info
Country-code TLDs also exist, such as:
.bd— Bangladesh.uk— United Kingdom.in— India.jp— Japan
What Is a Subdomain?
A subdomain is a name added before a main domain to create a separate address or section.
For example:
blog.example.com
shop.example.com
support.example.com
Here:
blog, shop, and support
are subdomains.
Subdomains can be useful for organizing different services or sections.
For example:
Main Website: example.com
Blog: blog.example.com
Store: shop.example.com
What Is Web Hosting?
Web hosting is a service or infrastructure that provides server resources for making website files or applications available to users.
A website may require storage and computing resources for:
- HTML files
- CSS files
- JavaScript files
- Images
- Videos
- Application code
- Databases
- Other website resources
These resources are placed on or served through a system connected to the Internet.
In simple terms:
Hosting = Where Your Website/Application Runs or Its Resources Are Served
Domain vs Hosting
A domain and hosting are related, but they are not the same thing.
| Domain | Hosting |
|---|---|
| Human-readable website address | Server resources/service used to serve the website |
| Helps users identify the site | Stores/serves files or runs the application |
Example: example.com | Web server/hosting environment |
| Uses DNS configuration | Provides website resources |
A simple analogy is:
Domain = Address of a house
Hosting = The property/building at that address
Website = What visitors experience there
The analogy is not technically exact, but it is useful for beginners.
What Is an IP Address?
IP = Internet Protocol
An IP address is a network address used to identify and route communication to a device or interface on an IP network.
Servers connected to the Internet can be reachable through IP addresses.
There are two major IP versions commonly discussed:
IPv4
Example:
192.0.2.1
IPv4 uses a 32-bit address space and is commonly written as four decimal numbers separated by dots.
IPv6
Example:
2001:db8::1
IPv6 uses a much larger 128-bit address space and is written using hexadecimal notation.
Public vs Private IP Address
IP addresses can also be discussed as public or private in common networking contexts.
Public IP Address
A public IP address is globally routable on the public Internet, subject to network configuration and routing.
Internet-facing servers commonly use public addressing directly or through network infrastructure.
Private IP Address
Private IPv4 addresses are used inside local networks and are not directly routed across the public Internet.
Common private IPv4 ranges include:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
For example, your home router may assign your computer an address such as:
192.168.1.10
That is a private IPv4 address.
Why Do We Need Domain Names?
Imagine needing to remember an IP address for every website you use.
That would be inconvenient.
Domain names provide memorable names such as:
example.com
instead of requiring users to work directly with network addresses.
But a mechanism is needed to find the information associated with a domain.
That mechanism is DNS.
What Is DNS?
DNS = Domain Name System
DNS is a distributed naming system used to associate domain names with information such as IP addresses.
A simple beginner model is:
Domain Name → DNS → IP Address
For example:
example.com
↓
DNS lookup
↓
Server IP information
The browser can then use the resolved information to communicate with the appropriate server.
Why Is DNS Important?
Humans prefer names.
Computers and network infrastructure need network addresses and related routing information.
DNS helps connect these two worlds.
Without DNS, normal website navigation using memorable domain names would be much less convenient.
How DNS Works
Suppose you enter:
www.example.com
into your browser.
A simplified DNS process is:
Step 1 — Enter Domain
You type:
www.example.com
Step 2 — Browser/Operating System Needs Address Information
The system needs to determine where the domain should be reached.
Step 3 — DNS Resolution Begins
Previously cached information may be checked first.
If the required information is not available locally, a DNS resolver can perform the necessary lookup process.
Step 4 — DNS Information Is Found
The resolver eventually obtains the relevant DNS record, such as an IP address for the hostname.
Step 5 — Browser Connects to the Server
The browser can use the resolved address to establish communication with the destination server.
Step 6 — Website Resources Are Requested
The browser sends the appropriate web request.
Step 7 — Server Responds
The server returns the appropriate response.
The simplified flow is:
Domain → DNS → IP Address → Server → Website
What Is a DNS Resolver?
A DNS resolver is a system that helps clients obtain DNS information.
When your device needs to resolve a domain name, it can send a query to a resolver.
The resolver may use cached information or query other DNS infrastructure to obtain an answer.
Common public DNS resolver services exist, but users often receive DNS resolver configuration automatically from their network provider.
DNS Resolution Flow
A more detailed conceptual flow can involve:
Browser / Operating System
↓
Recursive DNS Resolver
↓
Root DNS Server
↓
TLD DNS Server
↓
Authoritative DNS Server
↓
DNS Record
↓
Resolver
↓
Browser
This looks complicated at first, but the main idea is simple:
You enter a domain → DNS finds the relevant address information → Your browser can contact the server.
What Is a Nameserver?
A nameserver is a DNS server involved in providing DNS information for domains.
When you purchase a domain and use a hosting or DNS provider, you may be asked to configure nameservers.
Example format:
ns1.example-dns.com
ns2.example-dns.com
The actual values depend on your DNS provider.
Nameserver configuration helps determine where authoritative DNS information for your domain is managed.
What Is a DNS Record?
DNS records contain different types of information about a domain or hostname.
Some important records are:
A Record
An A record maps a hostname to an IPv4 address.
Conceptual example:
example.com → 192.0.2.10
AAAA Record
An AAAA record maps a hostname to an IPv6 address.
Example:
example.com → 2001:db8::10
CNAME Record
A CNAME record aliases one hostname to another hostname.
Conceptual example:
www.example.com → example.com
MX Record
An MX record identifies mail servers responsible for receiving email for a domain.
TXT Record
A TXT record stores text data associated with a domain.
TXT records are commonly used for purposes such as:
- Domain verification
- Email authentication policies
- Service verification
Important DNS Records
| Record | Main Purpose |
|---|---|
| A | Hostname → IPv4 address |
| AAAA | Hostname → IPv6 address |
| CNAME | Hostname → Another hostname |
| MX | Mail server information |
| TXT | Text-based verification/policy information |
| NS | Authoritative nameserver information |
What Is DNS Propagation?
When you change DNS records or nameserver configuration, users around the world may not all observe the new information immediately.
DNS data is cached for specified periods.
The process by which updated DNS information becomes visible through different caches and resolvers is commonly referred to as DNS propagation.
Depending on TTL values, caching, resolver behavior, and the type of change, updates may appear quickly in some locations and later in others.
What Is TTL?
TTL = Time To Live
In DNS, TTL indicates how long a DNS record may be cached before it should be refreshed.
For example, a lower TTL can cause resolvers to refresh information more frequently, while a higher TTL can allow information to remain cached longer.
TTL affects caching behavior and how quickly some DNS changes are observed.
How Domain and Hosting Connect
Suppose you:
- Buy a domain.
- Purchase hosting.
- Upload your website.
- Configure DNS.
- Point the relevant domain records toward your hosting/server.
- Wait for DNS changes to become available as caches update.
- Open the domain in a browser.
The simplified relationship becomes:
Domain
↓
DNS
↓
Server Address
↓
Hosting / Web Server
↓
Website
This is how a domain can be connected to the infrastructure serving a website.
Practical Example
Imagine you create an IT company website.
Your domain is:
myitcompany.com
Your website is hosted on a server.
A simplified process is:
Visitor enters myitcompany.com
↓
DNS resolves the domain
↓
Relevant server address is returned
↓
Browser connects to the web server
↓
Browser sends an HTTP/HTTPS request
↓
Server sends a response
↓
Website appears in the browser
This entire process can happen very quickly.
Domain Registration vs Hosting
You can often purchase a domain and hosting from the same company, but technically they are separate services.
For example:
Company A → Domain Registration
Company B → Hosting
You can then configure DNS so that the domain points to the hosting infrastructure.
This separation is important because changing hosting does not necessarily mean you must change your domain name.
What Happens When You Change Hosting?
Suppose your website moves from one hosting server to another.
The new server may have different address information.
You may need to update relevant DNS records so that your domain points to the new infrastructure.
Simplified:
Old Server → DNS Change → New Server
During migrations, developers should carefully manage:
- Website files
- Database
- DNS
- SSL/TLS
- Email configuration
- Backups
- Application configuration
- Downtime risk
Common Beginner Mistakes
1. Thinking Domain and Hosting Are the Same
They are different services.
Domain = Address/Name
Hosting = Infrastructure that serves/runs the website
2. Thinking DNS Is Hosting
DNS does not normally store and run your website application. It provides naming information that helps clients locate services.
3. Using the Wrong DNS Record
For example, an A record and CNAME record serve different purposes.
Understand the required record before changing DNS settings.
4. Changing Nameservers Without Understanding the Effect
Changing nameservers can change which DNS provider is authoritative for the domain.
Incorrect changes can affect:
- Website access
- Subdomains
- Verification records
5. Forgetting About DNS Caching
DNS changes may not appear everywhere immediately because existing records can remain cached.
6. Deleting Existing DNS Records Carelessly
Some records may be required for email, verification, or other services.
Always understand existing records before removing them.
New & Difficult Words
| Term | Meaning |
|---|---|
| Domain | Human-readable Internet name |
| Hosting | Infrastructure/service used to serve a website |
| IP | Internet Protocol |
| IP Address | Network address used for IP communication |
| IPv4 | Internet Protocol version 4 |
| IPv6 | Internet Protocol version 6 |
| DNS | Domain Name System |
| TLD | Top-Level Domain |
| Subdomain | Name placed before a main domain |
| Nameserver | DNS server involved in serving DNS information |
| DNS Record | A record containing DNS information |
| A Record | Maps a hostname to IPv4 |
| AAAA Record | Maps a hostname to IPv6 |
| CNAME | Canonical Name; aliases one hostname to another |
| MX | Mail Exchange |
| TXT | Text record |
| TTL | Time To Live |
| DNS Resolver | System that resolves DNS queries |
Important Notes
Remember:
Domain ≠ Hosting
Domain ≠ IP Address
DNS ≠ Hosting
The basic relationship is:
Domain → DNS → IP Address → Server → Website
Also remember:
A → IPv4
AAAA → IPv6
CNAME → Another hostname
MX → Mail
TXT → Text/verification/policy information
Practice Questions
- What is a domain name?
- What is web hosting?
- What is an IP address?
- What does DNS stand for?
- Why do we need DNS?
- What is a subdomain?
- What is a TLD?
- What is a nameserver?
- What is an A record?
- What is an AAAA record?
- What is a CNAME record?
- What is an MX record?
- What is a TXT record?
- What does TTL mean?
- Explain how a domain connects to a hosting server.
Assignment
Imagine you are launching a website called:
mycompany.com
Create a simple diagram showing:
User → Domain → DNS → IP Address → Hosting Server → Website
Then create a table containing these DNS records:
- A
- AAAA
- CNAME
- MX
- TXT
- NS
For each record, write:
- Full name
- Main purpose
- One example use
Finally, explain in 5–10 sentences what happens after a visitor enters mycompany.com into a browser.
Quiz
1. What is a domain name?
A domain name is a human-readable name used to identify and access Internet services such as websites.
2. What is web hosting?
Web hosting provides server resources used to make website files or applications available online.
3. What does IP stand for?
Internet Protocol.
4. What does DNS stand for?
Domain Name System.
5. What does an A record do?
It maps a hostname to an IPv4 address.
6. What does an AAAA record do?
It maps a hostname to an IPv6 address.
7. What is a CNAME record?
It aliases one hostname to another hostname.
8. What is an MX record used for?
It identifies mail servers for a domain.
9. What does TTL stand for?
Time To Live.
10. Are domain and hosting the same thing?
No. They are separate concepts and services.
Interview Questions
Q: What is the difference between a domain and hosting?
A domain is the human-readable name used to access a website, while hosting provides the infrastructure that stores, runs, or serves the website resources.
Q: What is DNS?
DNS stands for Domain Name System. It is a distributed naming system that associates domain names with information such as IP addresses.
Q: What is the difference between an A record and a CNAME record?
An A record maps a hostname directly to an IPv4 address, while a CNAME record aliases one hostname to another hostname.
Q: What is an IP address?
An IP address is a network address used to identify and route communication to devices or interfaces on an IP network.
Q: What happens when you enter a domain into a browser?
The system resolves the domain using DNS, obtains the relevant network address, connects to the appropriate server, sends a web request, receives a response, and the browser processes the returned resources.
Class Summary
In Class 03, you learned how domains, hosting, IP addresses, and DNS work together.
The most important flow is:
Domain → DNS → IP Address → Hosting Server → Website
You also learned about:
Domain → Human-readable name
Hosting → Website infrastructure
IP Address → Network address
DNS → Domain name resolution
A → IPv4
AAAA → IPv6
CNAME → Hostname alias
MX → Email routing information
TXT → Text-based information
These concepts are essential when publishing, migrating, configuring, or troubleshooting a real website.
Next Class: Class 04 — HTTP, HTTPS, URL, Browser & Request/Response