What is a DNS Record?
About
A DNS record is a row in a DNS database.
Example
Example of a A record.
api IN A 164.132.99.202
where:
- api is a relative name
- IN is the INTERNET class (An other value is ANY)
- A is the A record
- 164.132.99.202 is the Ip address
If the apex domain is example.com, this entry will point the qualified domain name api.example.com to the ip 164.132.99.202
Syntax
A record is a text line.
<name> <ttl> <class> <type> <rdata>
- name is the name or IP address for a ptr record
- ttl is the the time to live in the cache
- class is the network class being used. No more used only for compatiblity
- IN for Internet (The default and only)
- HS for Hesiod (deprecated)
- CH for Chaosnet (deprecated)
- type is the type of record
- rdata is output of the lookup
Type
Pointer
Pointer records that match a name to a destination:
- An A record maps a domain name to an IP address Version 4
- An AAAA'' record maps a domain name to an IP address Version 6.
- A CNAME record (Canonical Name) - map a name alias to a absolute/canonical name (alias system)
- NS - The DNS name server of the domain (where the DNS record of the domain are stored)
Extended
- CAA
- NAPTR
- LOC
- SSHFP
- TLAS
- What is a MX DNS record (Mail Exchanger Record)? - point to the mail server,
- SRV Record (Service AutoDiscovery) for email autodicovery
There is also a TXT record for each of the following mail authentication mechanism.
Others
- ANY,
- SOA,
Query
A query is also known as a lookup. Check the lookup page to known how to perform a query.
Time To Live (TTL)
The Time To Live (TTL) of a DNS record is generally of 5 minutes.
If clients cache the results of host name lookups in order to achieve a performance improvement, they MUST observe the TTL information reported by DNS. Ref - DNS Spoofing 2)