The term domain name is a name:
It's also known as domain, its short format.
This examples show how the domain name is used to define a host resource.
The Hostname is a domain name that identifies a host.
Example: host.example.com is a domain name
In the email address label@name, the domain name is the part after the arobase.
The domain portion identifies the point (node) to which the mail should be delivered:
In a url: https://host/path?query#fragment, the domain name is the host part that identifies a HTTP server.
With the following absolute name:
smtp.us.datacadamia.com.
You will read the name from right to left, with each level of the hierarchy divided by dots:
A domain name 1) is a succession of one or more labels separated by dots (known alas as the dot-atom form) that indicates the hierarchical structure (tree) of the namespace.
In a simplified way, a domain name looks like this:
[[.]label]*[.apexLabel][.tldLabel].rootLabel
where:
The domain is the namespace of the last label.
You can find the exact syntax at the end of this article as EBNF grammar
The label is zero to 63 octets in length. The domain name is the list of the labels on the path from the node to the root of the tree.
By convention, the labels that compose a domain name are printed or read left to right:
The text label encoding is ASCII. The international characters are supported via the punycode encoding.
A name has two kind of format:
A complete/qualified domain name ends always with the root label of the namespace tree, and therefore the complete/qualified printed form ends with a dot.
An absolute domain name is more known as the fully qualified domain name (or FQDN)
For example, smtp.us.datacadamia.com.
A relative domain name represents the starting labels and should be completed by the local domain or zone.
For example, the “smtp” name used in the us.datacadamia.com. (domain or zone)
A relative name is also known as the short name
They are the names stored in DNS records.
domain names can be written with arbitrary case, but domain name comparisons for all present domain functions are done in a case-insensitive manner
A node can be created with the label A or a, but they can't be sibling
The total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255.
A domain name may also be logically an administrative unit and be therefore called a zone.
A DNS name is an IP name stored in a DNS database. You will find the relative form in the first column of a DNS table.
In a DNS table, you would see:
NAME TYPE VALUE
--------------------------------------------------
bar CNAME foo.example.com.
foo A 192.0.2.23
where
Due to hosting, you may be at risk of a sub-domain takeover.
The exact definition of a domain name is given in the Rfc1024 - Preferred Name Syntax)
domain ::= subdomain | " "
subdomain ::= label | subdomain "." label
label ::= letter ( ( ldh-str ) let-dig )
ldh-str ::= let-dig-hyp | let-dig-hyp ldh-str
let-dig-hyp ::= let-dig | "-"
let-dig ::= letter | digit
letter ::= [A-Za-z]*
digit ::= [0-9]*