What is the difference between a domain name and a URL? Give an example of each.

Answer:

Answer by student

Domain name

URL

A human-readable name that identifies a website or a web server on the internet.

A specific address that locates a resource on the internet.

An example is www.google.com.

An example is https://www.google.com/search?q=teachoo.

 

Detailed answer by teachoo

-lock-

Domain name

URL

A human-readable name that identifies a website or a web server on the internet.

A specific address that locates a resource on the internet.

Consists of one or more labels separated by dots, such as www.google.com.

Consists of several components separated by special characters, such as https://www.google.com/search?q=teachoo.

The rightmost label is called the top-level domain (TLD), which indicates the category or the country of the domain name. For example, .com is a generic TLD for commercial websites, and .in is a country code TLD for India.

The first component is the scheme, which indicates the protocol or the method used to access the resource. For example, https means HyperText Transfer Protocol Secure, which is a secure version of HTTP.

The leftmost label is called the subdomain, which specifies a particular host or service within the domain name. For example, www is a common subdomain for web servers, and mail is a common subdomain for email servers. 

The second component is the authority, which includes the domain name and optionally the port number of the server. For example, www.google.com:80 means the web server at www.google.com using port 80. The third component is the path, which specifies the location or the name of the resource on the server. For example, /search means the search page on the web server. The fourth component is the query, which contains additional information or parameters for the resource. For example, q=teachoo means the search query for teachoo. The fifth component is the fragment, which identifies a specific part or section of the resource. For example, #results means the results section of the search page.

-endlock-

Remove Ads Share on WhatsApp
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.