URLs and Domain Names

Whenever we open a website, we normally enter an address such as:

https://www.example.com

This address helps the browser locate the correct website. Two important parts of web addressing are:

  • URL
  • Domain name

They are connected, but they are not the same thing.

What Is a URL?

URL stands for Uniform Resource Locator.

A URL is the complete address of a particular resource available on the internet.

A URL can point to:

  • A web page
  • An image
  • A video
  • A PDF file
  • A downloadable application
  • A particular section of a page
  • Another online resource

According to MDN Web Docs, a URL is the address of a unique resource on the internet and is used by browsers to retrieve published resources.

Simple Definition

A URL is the complete internet address of a web page, file or other online resource.

Examples of URLs

https://www.example.com
https://www.example.com/computer-basics
https://www.example.com/images/keyboard.jpg
https://www.example.com/notes/computer-network.pdf

Each URL points to a particular location or resource.

Real-Life Example of a URL

Imagine you want to send a parcel to someone.

You need a complete address containing:

  • Country
  • City
  • Street
  • House number
  • Room or flat number

Similarly, a URL provides the complete address of an online resource.

For example:

https://www.example.com/computer-basics/ram

Here:

  • https tells the browser how to communicate.
  • www.example.com identifies the website.
  • /computer-basics/ram identifies the required page.

Therefore, a URL works like the complete postal address of a resource.

Structure of a URL

Consider the following example:

https://learn.example.com:443/computer-basics/ram?level=beginner#types

This URL contains several parts.

flowchart TB
    A["Complete URL"]
    A --> B["Scheme: https"]
    A --> C["Host: learn.example.com"]
    A --> D["Port: 443"]
    A --> E["Path: /computer-basics/ram"]
    A --> F["Query and fragment: ?level=beginner#types"]

The standard structure can be written as:

scheme://host:port/path?query#fragment

The WHATWG URL Standard defines components such as scheme, host, port, path, query and fragment.

1. Scheme or Protocol

The scheme appears at the beginning of a URL.

Example:

https://

It tells the browser which method or protocol should be used to access the resource.

Common schemes include:

SchemePurpose
httpOpens a web resource using HTTP
httpsOpens a web resource using encrypted HTTP communication
ftpAccesses files using File Transfer Protocol
fileOpens a local file
mailtoOpens an email application
telStarts a telephone action on supported devices

HTTP and HTTPS

HTTP stands for Hypertext Transfer Protocol.

HTTPS stands for Hypertext Transfer Protocol Secure.

HTTPS uses encryption to protect data while it travels between the browser and the web server.

Example:

http://example.com
https://example.com

HTTPS is preferred for modern websites, especially when users enter:

  • Passwords
  • Payment information
  • Personal details
  • Email addresses

However, HTTPS only confirms that the connection to that domain is encrypted and authenticated using a certificate. It does not guarantee that everything written on the website is honest or correct.

2. Host or Hostname

The host identifies the computer or service that should receive the browser’s request.

In this URL:

https://learn.example.com/computer-basics

The hostname is:

learn.example.com

A hostname may contain:

  • Subdomain
  • Registered domain name
  • Top-Level Domain

3. Port Number

A port identifies a particular network service running on a server.

Example:

https://example.com:443

Here, 443 is the port number.

Common default ports include:

ProtocolDefault Port
HTTP80
HTTPS443
FTP21

Browsers normally hide default port numbers. Therefore, these URLs usually lead to the same service:

https://example.com
https://example.com:443

A port is normally shown only when a website or application uses a non-default port.

Example:

http://localhost:8080

4. Path

The path identifies a particular page, folder or resource on the server.

Example:

https://example.com/computer-basics/ram

The path is:

/computer-basics/ram

It can be understood as:

Website → Computer Basics → RAM page

Another Example

https://example.com/images/computer/keyboard.jpg

The path is:

/images/computer/keyboard.jpg

A path may represent an actual folder and file, but modern websites can also generate pages dynamically. Therefore, every part of a path does not necessarily represent a physical folder stored on the server.

5. Query String

A query string sends additional information to a website.

It begins with a question mark ?.

Example:

https://example.com/search?topic=computer

The query string is:

?topic=computer

A query parameter normally contains a key and value:

topic=computer

Here:

  • topic is the key.
  • computer is the value.

Multiple Query Parameters

Multiple parameters are normally separated using an ampersand &.

https://example.com/search?topic=computer&level=beginner

This URL contains two parameters:

KeyValue
topiccomputer
levelbeginner

Query strings are commonly used for:

  • Website searches
  • Filters
  • Sorting
  • Product categories
  • Language selection
  • Tracking
  • Page numbers

6. Fragment or Anchor

A fragment identifies a particular section inside a page.

It begins with a hash symbol #.

Example:

https://example.com/computer-memory#types

The fragment is:

#types

When the URL opens, the browser may move directly to the “Types” section of the page.

Fragments are useful for:

  • Table of contents links
  • Frequently asked questions
  • Long educational articles
  • Particular headings
  • A specific point in supported media

Complete URL Parts

URL PartExamplePurpose
SchemehttpsDefines how the resource is accessed
SubdomainlearnIdentifies a section or service
DomainexampleMain registered name
TLD.comHighest visible domain category
Port443Identifies a network service
Path/computer-basics/ramLocates a particular resource
Query?level=beginnerSends additional information
Fragment#typesOpens a particular page section

What Is a Domain Name?

A domain name is the human-readable name used to identify a website or internet service.

Examples include:

google.com
wikipedia.org
bbc.co.uk

Computers communicate using IP addresses, but IP addresses can be difficult for people to remember.

For example, remembering a name such as:

example.com

is easier than remembering an IP address such as:

192.0.2.10

ICANN explains that a domain name identifies an internet address and that DNS connects domain names with IP addresses. (ICANN)

Simple Definition

A domain name is the easy-to-remember name of a website that DNS connects to an IP address.

Real-Life Example of a Domain Name

Consider the contacts stored on your phone.

You select:

Rahul

Your phone uses Rahul’s telephone number to make the call. You remember the name, while the phone uses the number.

Similarly:

  • A domain name is like the contact name.
  • An IP address is like the telephone number.
  • DNS is like the phone’s contact list.
Contact name → Telephone number
Domain name → IP address

Structure of a Domain Name

Consider the following hostname:

learn.example.com

Its structure is hierarchical.

flowchart LR
    A["DNS root: ."] --> B["Top-Level Domain: .com"]
    B --> C["Registered domain: example.com"]
    C --> D["Subdomain: learn.example.com"]

Domain hierarchy is understood from right to left.

In learn.example.com:

  • .com is the Top-Level Domain.
  • example is the registered name.
  • learn is the subdomain.

ICANN describes domain names as hierarchical names made from segments separated by dots. (ICANN)

1. DNS Root

The DNS root is the highest level of the Domain Name System.

Technically, a fully qualified domain name can end with a dot:

example.com.

The final dot represents the DNS root, but browsers and users normally omit it.

IANA manages the DNS root zone and maintains authoritative information about Top-Level Domains. (IANA)

2. Top-Level Domain

A Top-Level Domain, or TLD, is the final visible part of a domain name.

Examples:

  • .com
  • .org
  • .net
  • .uk
  • .in
  • .edu
  • .online
  • .tech

In:

example.com

the TLD is:

.com

Generic Top-Level Domains

Generic Top-Level Domains are commonly called gTLDs.

Examples include:

  • .com
  • .org
  • .net
  • .info
  • .online
  • .tech

Country-Code Top-Level Domains

Country-Code Top-Level Domains are called ccTLDs.

They normally contain two letters.

Examples include:

Country or TerritoryccTLD
United Kingdom.uk
India.in
United States.us
Canada.ca
Australia.au
Germany.de

The IANA Root Zone Database contains official delegation information for TLDs, including generic TLDs such as .com and country-code TLDs such as .uk.

3. Second-Level or Registered Domain

The registered name normally appears immediately before the TLD.

Example:

example.com

Here:

  • example is the registered label.
  • .com is the TLD.
  • example.com is the registered domain.

Country-Code Structure

Some country-code systems use an additional category.

Example:

example.co.uk

Here:

  • .uk is the official country-code TLD.
  • co.uk is a commonly used public suffix or category.
  • example.co.uk is the domain normally registered by the website owner.

4. Subdomain

A subdomain is an additional part placed before the registered domain.

Example:

learn.example.com

Here, learn is the subdomain.

Subdomains can separate different services or areas of a website.

SubdomainPossible Purpose
www.example.comMain website
blog.example.comBlog
shop.example.comOnline store
learn.example.comLearning platform
support.example.comCustomer support
mail.example.comEmail service

Is WWW Compulsory?

No. www is a subdomain, and it is not compulsory.

A website may use:

www.example.com

or:

example.com

Website owners usually select one version as the main version and redirect the other version to it.

How DNS Connects a Domain to a Website

DNS stands for Domain Name System.

DNS translates human-readable domain names into IP addresses that computers can use.

Suppose you enter:

https://www.example.com

The following process occurs:

flowchart TB
    A["User enters example.com"]
    A --> B["Browser asks a DNS resolver"]
    B --> C["Resolver finds the DNS information"]
    C --> D["Domain is matched with an IP address"]
    D --> E["Browser connects to the web server"]
    E --> F["Server sends the requested web page"]

DNS Process in Simple Steps

  1. You enter a domain name in the browser.
  2. The browser checks whether it already knows the IP address.
  3. The operating system or network asks a DNS resolver.
  4. The resolver finds the appropriate DNS information.
  5. The IP address is returned.
  6. The browser connects to the server.
  7. The server sends the requested web page.

ICANN describes DNS as the internet’s address book because it connects domain names with IP addresses. (ICANN)

DNS Hierarchy

If the required answer is not already cached, DNS resolution may involve different levels.

flowchart TD
    A["DNS resolver"]
    A --> B["Root DNS server"]
    B --> C["TLD server, such as .com"]
    C --> D["Authoritative name server"]
    D --> E["IP address for the domain"]

Root DNS Server

It directs the resolver towards the correct TLD server.

TLD Server

It provides information about the domain’s authoritative name servers.

Authoritative Name Server

It stores the final DNS records for the domain.

DNS Cache

DNS answers are temporarily stored in a cache.

Caching makes future requests faster because the same DNS lookup may not need to be repeated immediately.

Common DNS Records

A domain can contain different DNS records.

DNS RecordPurpose
AConnects a domain to an IPv4 address
AAAAConnects a domain to an IPv6 address
CNAMEMakes one hostname an alias of another hostname
MXIdentifies email servers for the domain
NSIdentifies the domain’s authoritative name servers
TXTStores text used for verification and security settings

Simple Example

A website may use:

example.com → A record → Web server IP address

Its email may use:

example.com → MX record → Email server

Therefore, one domain can be used for several services.

Domain Name vs URL

A domain name is only one part of a URL.

Example:

https://www.example.com/computer-basics/ram?level=beginner#types

The domain name is:

example.com

The complete URL is:

https://www.example.com/computer-basics/ram?level=beginner#types
Domain NameURL
Identifies a website or internet serviceIdentifies a particular resource
Forms part of a URLMay contain protocol, domain, path and other components
Example: example.comExample: https://example.com/about
Does not identify a particular page by itselfCan identify an exact page, file or section

Easy Example

Think of an apartment building:

  • The domain name is the building’s address.
  • The URL is the building address plus the exact floor and flat number.

Domain Name vs IP Address

Domain NameIP Address
Designed to be easier for people to rememberDesigned for network identification and routing
Usually contains readable wordsContains numbers or hexadecimal characters
Example: example.comExample: 192.0.2.10
DNS translates it into an addressComputers use it to locate a network destination
Can point to a different IP laterMay change when hosting changes

One domain may sometimes point to multiple IP addresses for performance and reliability.

Multiple domain names may also point to the same server.

Domain Name vs Web Hosting

A domain name and web hosting are separate services.

Domain Name

A domain name is the website’s readable address.

Example:

example.com

Web Hosting

Web hosting provides server space where website files and data are stored.

Real-Life Example

Think of a shop:

  • Domain name = shop address
  • Hosting = shop building
  • Website files = products and furniture inside the shop

Buying a domain does not always include hosting. Similarly, purchasing hosting does not automatically give you every domain name you want.

Domain Name vs Website

A domain name is an address, while a website is a collection of pages and resources.

For example:

  • example.com is the domain.
  • Home, About, Contact and Blog are website pages.

One domain can contain:

  • Many pages
  • Multiple subdomains
  • Images
  • Videos
  • Downloads
  • Email services

Website, Web Page and URL

TermMeaningExample
WebsiteA collection of related web pagesAn educational website
Web pageOne document inside the websiteA “What Is RAM?” article
DomainMain readable website addressexample.com
URLComplete address of a resourcehttps://example.com/ram

Absolute and Relative URLs

URLs can be absolute or relative.

Absolute URL

An absolute URL contains the complete address.

Example:

https://example.com/computer-basics/ram

It normally includes:

  • Scheme
  • Domain
  • Complete path

Absolute URLs can be used from any website.

Relative URL

A relative URL contains only the path relative to the current website or page.

Example:

/computer-basics/ram

If this link appears on https://example.com, the browser can create the complete URL:

https://example.com/computer-basics/ram

Comparison

Absolute URLRelative URL
Contains the complete addressContains a partial address
Includes scheme and hostnameUsually omits scheme and hostname
Can point to another websiteUsually points inside the current website
Example: https://example.com/aboutExample: /about

What Is a Slug?

A slug is the readable final part of a web page’s path.

Example:

https://example.com/computer-basics/what-is-ram

The slug is:

what-is-ram

A good slug should clearly describe the page.

Good example:

/what-is-computer-network

Poor example:

/page?id=84729

URL Encoding

URLs cannot use every character directly in every position.

Some characters are converted into a special encoded form called percent encoding.

For example, a space may appear as:

%20

Therefore:

computer memory

may become:

computer%20memory

Browsers often perform this conversion automatically.

Are URLs Case-Sensitive?

Different parts of a URL may behave differently.

Scheme and Domain

The scheme and hostname are not normally case-sensitive.

These hostnames are treated the same:

EXAMPLE.COM
example.com

Path and Query

The path and query may be case-sensitive, depending on the server and application.

These could be treated as different URLs:

example.com/Computer
example.com/computer

For consistency, website owners should normally use lowercase URLs.

Domain Registration

A person or organization registers a domain through a domain registrar.

The main participants include:

ParticipantRole
RegistrantPerson or organization registering the domain
RegistrarCompany through which the domain is registered
RegistryOrganization maintaining records for a TLD
ICANNCoordinates important parts of the global domain-name system
IANAMaintains root-zone and TLD delegation information

A registrar provides domain registration services and manages details such as registration periods, renewals and transfers. (ICANN)

Basic Domain Setup Process

flowchart LR
    A["Choose a domain"] --> B["Register it"]
    B --> C["Connect DNS"]
    C --> D["Connect hosting"]
    D --> E["Enable HTTPS"]

A domain registration must normally be renewed. If it expires and is not recovered in time, someone else may eventually be able to register it.

Internationalized Domain Names

Traditional domain names mainly used Latin letters, numbers and hyphens.

Internationalized Domain Names, or IDNs, allow supported names to use characters from scripts such as:

  • Devanagari
  • Arabic
  • Chinese
  • Cyrillic

ICANN explains that IDNs enable people to use domain names in local languages and scripts. (ICANN)

Browsers and DNS systems may internally encode these names into an ASCII-compatible format.

How to Identify the Real Domain in a URL

Cybercriminals sometimes create confusing URLs.

Consider this example:

https://paypal.com.account-check.example.net/login

A beginner might notice paypal.com and assume it belongs to PayPal.

However, the actual registered domain is:

example.net

Everything before it is part of a subdomain:

paypal.com.account-check

Easy Checking Method

Read the hostname carefully from right to left:

paypal.com.account-check.example.net
                                  ←
  • .net is the TLD.
  • example.net is the registered domain.
  • The words before it are subdomains.

Do not trust a website only because a familiar company name appears somewhere in the URL.

URL and Domain Safety Tips

Before opening a link or entering personal information:

  • Read the complete domain carefully.
  • Check for spelling mistakes.
  • Watch for extra letters or numbers.
  • Do not trust a familiar name appearing only in a subdomain.
  • Prefer HTTPS, especially for passwords and payments.
  • Remember that HTTPS does not prove that the website itself is honest.
  • Avoid entering information after opening an unexpected link.
  • Be careful with shortened URLs because they can hide the destination.
  • Do not ignore browser certificate warnings.
  • Use bookmarks or type the official domain for important services.
  • Check the domain before downloading a file.
  • Avoid suspicious attachments and login pages.

Suspicious Domain Examples

paypa1-example.com

The number 1 has been used instead of the letter l.

micros0ft-login.example

The number 0 has been used instead of the letter o.

These are examples only, but similar techniques are used in phishing attacks.

SEO-Friendly URL Best Practices

Website owners should create URLs that are easy for both users and search engines to understand.

Use Descriptive Words

Recommended:

/computer-basics/what-is-ram

Avoid:

/page-84729

Keep URLs Short and Clear

Avoid unnecessary folders, numbers and parameters.

Recommended:

/computer-network/lan-and-wan

Unnecessarily complicated:

/category1/folder4/page.php?id=9284&type=7

Use Hyphens Between Words

Recommended:

/what-is-computer-network

Avoid:

/what_is_computer_network

Google recommends using hyphens instead of underscores to separate words and advises reducing unnecessary URL parameters. (Google Search Central)

Use Lowercase Letters

Recommended:

/computer-basics

Avoid:

/Computer-Basics

Use HTTPS

Use HTTPS across the entire website and redirect old HTTP URLs to their HTTPS versions.

Avoid Frequently Changing URLs

Changing an established URL can break:

  • Bookmarks
  • Internal links
  • External backlinks
  • Search-engine records

If a URL must change, use an appropriate permanent redirect from the old URL to the new URL.

Select One Preferred URL

The same content may sometimes appear through multiple URLs.

A canonical URL helps identify the preferred version. Google describes canonicalization as selecting a representative URL from duplicate or very similar pages. (Google Search Central)

Recommended URL Structure for an Educational Website

A clear structure might look like:

https://example.com/computer-fundamentals/
https://example.com/computer-fundamentals/input-devices/
https://example.com/computer-networks/lan-and-wan/
https://example.com/internet/search-engines/

This structure helps users understand:

  • The website
  • The main category
  • The topic of the page

Common Misconceptions

Misconception 1: URL and Domain Name Are the Same

A domain name is only one part of a complete URL.

Misconception 2: WWW Is the Internet

www is simply a commonly used subdomain. It is not the internet itself.

Misconception 3: Every URL Must Contain WWW

A website can work with or without www, depending on its configuration.

Misconception 4: Buying a Domain Automatically Creates a Website

A domain provides an address. You still need hosting, website files and configuration.

Misconception 5: HTTPS Means the Website Is Completely Trustworthy

HTTPS protects the connection. A fraudulent website can also obtain an HTTPS certificate.

Misconception 6: One Domain Can Point to Only One Server

DNS can connect a domain with multiple servers or IP addresses.

Misconception 7: A Domain Is Purchased Forever

Domains are normally registered for a limited period and must be renewed.

Frequently Asked Questions

What does URL stand for?

URL stands for Uniform Resource Locator.

What is a URL in simple words?

A URL is the complete address of a web page, file or other internet resource.

What is a domain name?

A domain name is a readable internet name that DNS can connect with an IP address.

What is the difference between a domain and a URL?

A domain identifies the website, while a URL identifies a complete location or resource.

Is WWW part of a domain?

www is normally a subdomain. It is not compulsory.

What is a TLD?

A TLD is the final part of a domain name, such as .com, .org, .uk or .in.

What is a subdomain?

A subdomain is an additional name placed before a registered domain, such as blog in blog.example.com.

What is DNS?

DNS is the system that translates domain names into IP addresses and provides other domain-related information.

What is a URL path?

A path identifies a particular page, file or resource within a website.

What does the question mark in a URL mean?

A question mark begins the query string.

Example:

?topic=computer

What does the hash symbol in a URL mean?

A hash symbol begins a fragment that can point to a particular section of a page.

Example:

#types

Can a URL use an IP address instead of a domain?

Yes. A URL can sometimes contain an IP address.

Example:

http://192.0.2.10

However, public websites normally use domain names because they are easier to remember and manage.

Can an IP address change while the domain stays the same?

Yes. The domain’s DNS records can be updated to point to a different IP address.

Does buying a domain include hosting?

Not always. Domain registration and web hosting are separate services, although some companies sell them together.

What is a slug?

A slug is the readable final part of a page’s URL path.

Why are short and descriptive URLs better?

They are easier to read, remember, share and understand.

Conclusion

A URL is the complete address of an online resource, while a domain name is the readable name that identifies a website or internet service.

The simplest way to remember the difference is:

Domain name = Website address
URL = Complete address of a particular resource

For example:

Domain: example.com
URL: https://example.com/computer-basics/ram

When a user enters a URL, DNS helps find the domain’s IP address, the browser connects to the appropriate server, and the server returns the requested page.

The complete process can be remembered as:

flowchart LR
    A["Enter URL"] --> B["Find domain through DNS"]
    B --> C["Get IP address"]
    C --> D["Connect to server"]
    D --> E["Display resource"]

Continue Learning