About
The term domain name is a name:
- in the Domain NameSpace (DNS)
- that identifies an object (known also as node)
It's also known as domain, its short format.
Usage Example
This examples show how the domain name is used to define a host resource.
HostName
The Hostname is a domain name that identifies a host.
Example: host.example.com is a domain name
Email address
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:
- either a hostname
- or a mail exchanger name
Url
In a url: https://host/path?query#fragment, the domain name is the host part that identifies a HTTP server.
Name Example
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:
- the invisible null character is the root (at the right of the point)
- com, datacadamia, us and smtp are labels
- com. is the Top Level domain
- datacadamia is the apexLabel of the apex domain name datacadamia.com.
- datacadamia.com. is a subdomain of com.
- us.datacadamia.com. is a subdomain of datacadamia.com.
- us.datacadamia.com. is the domain for the label smtp
- Zone
- smtp being the furthest left label may be the hostname (short) (if the resource is a host)
- Except for the hostname, every section is called a zone zone, which defines a particular namespace:
- us.datacadamia.com. is a zone
- datacadamia.com. is a zone
- com. is a zone
Syntax
Hierarchical Name
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:
- labels is one or more a string that starts with a letter separated by a point (used commonly to define a hostname)
- apexLabel is the label that defines the apex domain name (known as the registrable domain)
- tldLable is the label of the top-level domain name
- rootLabel is the label of the root which is the null character.
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:
- from the most specific (lowest, farthest from the root)
- to the least specific (highest, closest to the root).
Text label Encoding
The text label encoding is ASCII. The international characters are supported via the punycode encoding.
Relative (Short) vs Absolute
A name has two kind of format:
- a absolute - smtp.us.datacadamia.com.
Absolute
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.
Relative
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.
Case
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
Length Limitations
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.
Zone
A domain name may also be logically an administrative unit and be therefore called a zone.
Storage
DNS record
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
- name is a relative name (ie IP NAME)
Host file
Hosting
Security
Subdomain TakeOver
Due to hosting, you may be at risk of a sub-domain takeover.
Registration
Grammar
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]*