What is the difference between host name and sub-domain name?

1

We know that Fully Qualified Domain Name (FQDN) consists of hostname.domain.TLD.

Is that hostname also called the subdomain name?  What's the hostname and what's the subdomain name?

Shateel

Posted 2017-11-09T06:42:23.770

Reputation: 111

1It depends on the context. They can be same but usually you use a hostname to reference that specific host while you use a subdomain in the context of web service and such. You only got one hostname but can have multiple subdomains that are handled by that host. In addition a hostname doesn't necessarily have to reflect an actual DNS entry. – Seth – 2017-11-09T06:57:22.630

What's commonly called the "hostname" is the first label of a DNS FQDN that references a specific machine. Just chop off everything after the first dot. – milli – 2017-11-27T23:58:35.340

Answers

1

DNS allows for arbitrary nesting of labels. There is no requirement that any specific label refer to a specific node.

A "node" is a sequence of labels, where typically, each label indicates a point of delegation.

For example, com and uk are labels designating top-level domains. Within uk there is a static subdomain structure where effectively the "top level" is gov.uk, or.uk, ac.uk, co.uk etc (meaning "top" as in you can't register anything in uk directly, though of course the uk administrators could decide to add new second-level labels). Many countries have this second level, though it is by no means universal (and some countries and domains have yet more internal levels like this).

For example, example.com is delegated by the com top-level domain (also called "zone") to its owner, who can further delegate individual nodes within this domain. So the owner of example.com could decide that there will be a subdomain mail.example.com and it shall contain mail servers whose names could be mx1.mail.example.com, mx2.mail.example.com, etc. This isn't very common in practice, but a really large organization could delegate part or all of its DNS further to individual departments or separate organizations.

(A common example in real life is service providers. If you run a web or email service on example.net you might have ajax.example.net, acme.example.net etc and have each of these delegated to your customers Ajax Inc and Acme Corp. Another scenario is regional services -- na.example.org to serve North America, eu.example.org to serve Europe, etc.)

To finally answer your actual question, whether a node is an actual host (an actual server) or just another level in the DNS is completely up to the organization who owns it. It's not uncommon for a node to have both roles (mail.example.info could be an actual mail server with an IP address, and there could still be a DNS zone containing mx1.mail.example.info and mx2.mail.example.info etc. This is not a very compelling example, I'm afraid, but there is no technical reason you couldn't do this. I'll try to think of a better example...)

A "subdomain" is just an indication that a particular label is below the top level and contains additional nodes within. So, "sub" as in "not top", and "domain" as in "label containing more labels".

The disconnect between the mechanics of DNS (there are "zones" with "labels" identifying "nodes") and the actual real-world semantics (there is a set of root, aka top-level domains, and domains within them which are bought and sold, and subdomains within these which typically are arbitrary subdivisions implemented by the domain owner) is by and large a feature, not a bug. The implementation does not specify any particular policy, and can be used for things which are not currently in any policy. We have seen this spark useful innovations and new policies multiple times.

tripleee

Posted 2017-11-09T06:42:23.770

Reputation: 2 480

I know at some point somebody had a mail server running on their top-level domain ... If I recall correctly it was somebody@dk but I haven't bothered googling this. – tripleee – 2017-11-09T08:42:52.487