What’s the difference between a hostname and a domain name?
Hostname
Hostname is the name of the single server or machine endpoint where the website data is stored. In the computer network system, hostname or nodename identifies the device or the server. Hostname identifies the device with a network of devices. For example: “dns.google” etc.
Domain name
A domain name represents the website address on the internet, which can be based on many servers. It is used to identify various services provided through the internet, which includes websites, email services, and other services. It is the equivalent of a unique physical address on the internet. For example: “ipinfo.io”, “host.io” etc.
Domain names are typically made up of two or more parts, separated by periods or dots. The part on the left is called the "top-level domain" (TLD), and the part on the right is the "second-level domain" (SLD).
The TLD is the portion of the domain name that comes after the final period, and it specifies the type of organization or purpose of the website. Some examples of TLDs include ".com" (commercial), ".org" (organization), ".edu" (education), and ".gov" (government). The SLD is the portion of the domain name that comes before the TLD and is usually the name of the website or organization.
By combining the hostname and domain name, you get FQDN (Fully Qualified Domain Name)