> For the complete documentation index, see [llms.txt](https://karansingh.gitbook.io/aws-saa-c02/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://karansingh.gitbook.io/aws-saa-c02/route53/dns-record-types.md).

# DNS Record Types

## A record and AAAA record

* **Indicates the IP address of a given domain**.<br>
* **A records hold IPv4 addresses**.<br>
* **AAAA record hold IPv6 addresses**.

## CNAME record

* The ‘**canonical name**’ (CNAME) record.<br>
* **Forwards one domain to another domain, it cannot be an IP address**.<br>
* **Only work for non-root domains, e.g.** `somethinghastogohere.mydomain.com`.
  * You can't have CNAME records without there being something where `somethinghastogohere`is.

## Alias

* **Free** of charge.<br>
* **Native health checks**.<br>
* You **create alias records to route traffic to selected AWS resources, e.g. map your record name (example.com) to the DNS name for an AWS resource(elb1234.elb.amazonaws.com)**.<br>
* **Works for root domains and non-root domains**.<br>
* Alias record typically have a type of A or AAAA, but **they work like a CNAME record**.

## NS record

* Stands for ‘nameserver,’ and the **nameserver record indicates which DNS server is authoritative for that domain**.<br>
* NS records tell the Internet **where to go to find out a domain's IP address**.

## TTL record

* Time To Live (TTL) is kind of **like an expiration date that is put on a DNS record**.<br>
* Used to tell the recursive server or local resolver **how long it should keep said record in its cache**.<br>
* **The longer the TTL = the longer the resolver holds that information in its cache; less traffic on DNS servers**.<br>
* **The shorter the TTL, the shorter amount of time the resolver holds that information in its cache; more traffic on DNS servers**.<br>
* For example **example.com has an A-record at the apex of the zone to point us to a server**.
  * **With a TTL of 3600 seconds** (1 hour), that means that as a recursive server learns about example.com, it will **store that information about the A-record at example.com for one hour**.
    * **Anyone else who uses that same resolver will get the same answer**, and on the authoritative side, there will be **no query to the server unless the TTL runs out**.<br>
* **Lower TTL = Better for users with caching and when changing things related to DNS**.
