Domain vs URL: Understand the differences
They look very similar. But, many people may be confused between a Domain vs URL. In this article we will explain their difference and show some examples, to clarify these concepts.
What is a domain name?
Firstly, a domain name (RFC 1035) is an internet resource name. It locates an organization or other entity on the Internet. In general, a domain name is an address via which internet users can access your website. The Domain names are assigned as per the rules and procedures of the Domain Name System (DNS protocol). Any publicly-accessible name in the DNS is a domain name.
To access any web-based service a user needs to use a valid domain name.
Examples of domain names: copahost.com, google.com, yahoo.com
What is an URL?
URL stands for the Uniform Resource Locator (RFC 1738). It is a unique identifier that is used for locating the files on the internet. It’s a web address, that we use to identify a specific resource on the network.
There are parts of a URL:
- Protocol: usually HTTP or HTTPS
- Subdomain: usually www
- Domain name
- Path + internal page
- GET parameters
Examples of URLs:
So the format of an URL is always: protocol + subdomain + domain + path + filename.
Domain name vs URL. How to extract the domain name from the URL
There are differences between URL and domain names. The URL is a string of information providing the complete address of the web page on the internet. Whereas domain name is a part of URL which is a user-friendly form of IP address. We use the URL for identifying a particular web page.
For example, http://www.abzwebpedia.com/index.html is a complete URL. “abzwebpedia.com” is the domain name.
Moreover, the subdivisions of URL are done on the basis of the method, hostname (domain name), port and path. However, the domain name is a subdomain, domain and top-level domain,
What is a subdomain?
Simply, subdomain or also referred to as a child domain is domain name with a prefix. It is basically part of the main domain name. For example, www.abz.com is a URL and “www” is the subdomain.
Here’s the basic difference between a domain and a subdomain:
- abz.com is the main domain name
- store.abz.com is a subdomain
- private.abz.com is a subdomain
The organization of domain names (by countries)
Each country organizes its domain names according to a hierarchy. So, the Internet domain names come in four major types. For instance, they are top-level domains, second-level domains, third-level domains, and country domains. These domains are further segregated into the subsections so as to provide information about the various given domains.
For organizing the domain names for countries, each nation in the world is designated a top-level Internet domain. Each of them has a unique two-letter alphabetic code. Basically, each country has a specific entity, responsible for its top-level domains (TLD’s).
When we consider domain vs URL, only the domain name may have a relation with a specific country. So, the URL is not “country-sensitive”.
Some examples of country-specific TLD’s:
- Brazil – .br
- Italy – .it
- Portugal – .pt
- Mexico – .mx
- China – .cn
- Russia – .ru
- India – .in
Examples of international TLD’s (domain extensions not related to a specific country):
What are the differences between HTTP and HTTPS in the URL
Hyper Text Transfer Protocol (HTTP) is a protocol. In other words, it’s a set of rules and standards.
Moreover, the hyper-text exchanged using HTTP goes as plain text. Thus this protocol is not secure and is susceptible to interception. Whereas, on the other hand, HTTPS is a secure protocol. It works in conjunction with TLS/SSL (Secure Socket Layer) certificate. The certificate, then, is to ensure the authentication of the flow of information between the browser and the server. This other article HTTP vs HTTPS explain in details this difference inside the URL.
DNS and URL
How does the DNS Server work in case of a specific URL? The domain name is responsible for the DNS resolving. First of all, as we request a specific URL from a server, the local DNS resolver of our provider will find its domain name. Then, if there is a subdomain it will ask for the IP address of it. Then, having the IP address, our browser will connect to the webserver, and ask for the content inside the path of it.
Let’s exemplify step by step how the DNS works with a URL:
- Firstly, we will try to access this URL: https://login.bikestore.com/internal/file.html
- Then, the DNS resolver queries the domain name bikestore.com for the IP address of the subdomain login.bikestore.com
- Now, having its IP address, it will establish a connection with the webserver.
- And finally, being connected to the web server, it will ask for the contents of the URL path and file /internal/file.html
Some more examples
Path in an URL
For example, let’s consider an URL: https://secure.somesite.com/internal/data/file.html
What’s the path in this URL? Answer: the path in this URL is /internal/data/
Domain vs URL prefix
Another example, let’s consider an URL: https://store.canadian.com/login/area.html
In this sample, the URL prefix is https://, which is also considered the protocol.
The domain name is canadian.com. The subdomain is store.canadian.com