SOA
The SOA
record (Start Of Authority) indicates the server in charge for
the zone (primary server), the technical contact address (hostmaster
)
as well the parameter managing the domain: serial number (serial
),
refresh delay (refresh
), delay before a new retry (retry
), expiration
delay (expire
), negative caching time (minimum
).
1 2 3 4 5 6 |
|
If a dot (.
) is present in the mail address, it is necessary to
protect the dot by prefixing it with the anti-slash character (\
).
Field in SOA | |
---|---|
hostmaster@example.com |
hostmaster.example.com |
john.doe@example.com |
john\.doe.example.com |
NS
The NS records name servers to contact to obtain information on the zone, it generally includes the primary server (master), the other being the secondary servers (slave). A minimum of 2 servers is required (by the registrars) to manage to zone and ensure stability in case of failure of one of the servers.
1 2 |
|
To obtain a good resilience toward a server or network failure, the following care can be taken in the server choice:
- hosting on different servers;
- naming on different domains (ie:
ns1.example.com
,ns1.sample.net
); - use of different network (ie: AS).
If the NS
record used to delegate the domain is part of the domain,
then it is also necessary to have in the delegation the corresponding
A
and AAAA
records. It is called “glue”.
1 2 3 4 |
|
The NS
record must be resolved directly by an IP address (A
or AAAA
),
a redirection using CNAME
is forbidden (see: RFC1912).
MX
The MX record indicates by priority order the SMTP server to contact to send email to this domain. The lower the number, the higher the priority.
1 |
|
The MX
record must be resolved directly by an IP address (A
or AAAA
),
a redirection using CNAME
is forbidden (see: RFC1912).
A
The A
record creates a mapping from a name to the IPv4 address.
1 |
|
AAAA
The AAAA
record creates a mapping from a name to the IPv6 address. It
is similar to the A
record.
1 |
|
PTR
The PTR
record has the opposite meaning of the A
and `AAAA records in
allowing to find from an IP address the corresponding name.
1 |
|
The creation of a PTR
record is important for the correct
configuration of services such as mail, ssh access, … Indeed, it is
often used as a verification mechanism of the host identity
1 2 3 4 5 6 7 |
|
CNAME
The CNAME
record allows to create aliases or redirections. It is
particularly useful when a host must be known from several names.
1 |
|
If a CNAME
is used as an alias to create a service, it is necessary to
ensure that the whole set of addresses (A
and AAAA
) declared allow
to effectively access the service.
If we use the example above for a web service defined in the DNS by
www and running on the server named host, the typical error is to
define the IPv4 (A
) and IPv6 (AAAA
) addresses to access to the
server named host and to only have the mentioned service listening on
IPv4. This results in the service being declared as accessible using
IPv6 even if it is not the case.
SPF
SPF
record (Sender Policy Framework) allows to indicate which servers
are officially authorised to send mail for the domain or host.
1 |
|
SSHFP
SSHFP
record holds an SSH fingerprint. The DNS then allows to publish
the fingerprint and make it available to various clients so that they
can validate the authenticiy of the host on which they are connecting.
1 2 |
|
The following command, to run on the chosen server, allows to generate
the records to put in the DNS, the keys taken into account being the
server’s (by default: /etc/ssh/ssh_host_*_key.pub
).
1 |
|
LOC
The LOC
record allows to specify the geographical position: latitude,
longitude, height, and sphere of uncertainty.
1 |
|