# DNS

{% tabs %}
{% tab title="DNS Records" %}

<table><thead><tr><th width="194">Record</th><th width="476">Description</th></tr></thead><tbody><tr><td><code>Resource Record</code></td><td>A domain name, usually a fully qualified domain name, is the first part of a Resource Record. If you don't use a fully qualified domain name, the zone's name where the record is located will be appended to the end of the name.</td></tr><tr><td><code>TTL</code></td><td>In seconds, the Time-To-Live (<code>TTL</code>) defaults to the minimum value specified in the SOA record.</td></tr><tr><td><code>Record Class</code></td><td>Internet, Hesiod, or Chaos</td></tr><tr><td><code>Start Of Authority</code> (<code>SOA</code>)</td><td>It should be first in a zone file because it indicates the start of a zone. Each zone can only have one <code>SOA</code> record, and additionally, it contains the zone's values, such as a serial number and multiple expiration timeouts.</td></tr><tr><td><code>Name Servers</code> (<code>NS</code>)</td><td>The distributed database is bound together by <code>NS</code> Records. They are in charge of a zone's authoritative name server and the authority for a child zone to a name server.</td></tr><tr><td><code>IPv4 Addresses</code> (<code>A</code>)</td><td>The A record is only a mapping between a hostname and an IP address. 'Forward' zones are those with <code>A</code> records.</td></tr><tr><td><code>Pointer</code> (<code>PTR</code>)</td><td>The PTR record is a mapping between an IP address and a hostname. 'Reverse' zones are those that have <code>PTR</code> records.</td></tr><tr><td><code>Canonical Name</code> (<code>CNAME</code>)</td><td>An alias hostname is mapped to an <code>A</code> record hostname using the <code>CNAME</code> record.</td></tr><tr><td><code>Mail Exchange</code> (<code>MX</code>)</td><td>The <code>MX</code> record identifies a host that will accept emails for a specific host. A priority value has been assigned to the specified host. Multiple MX records can exist on the same host, and a prioritized list is made consisting of the records for a specific host.</td></tr></tbody></table>
{% endtab %}

{% tab title="nslookup/dig" %}

| Command                            | Description                                          |
| ---------------------------------- | ---------------------------------------------------- |
| `nslookup $TARGET`                 | Identify the `A` record for the target domain.       |
| `nslookup -query=A $TARGET`        | Identify the `A` record for the target domain.       |
| `dig $TARGET @<nameserver/IP>`     | Identify the `A` record for the target domain.       |
| `dig a $TARGET @<nameserver/IP>`   | Identify the `A` record for the target domain.       |
| `nslookup -query=PTR <IP>`         | Identify the `PTR` record for the target IP address. |
| `dig -x <IP> @<nameserver/IP>`     | Identify the `PTR` record for the target IP address. |
| `nslookup -query=ANY $TARGET`      | Identify `ANY` records for the target domain.        |
| `dig any $TARGET @<nameserver/IP>` | Identify `ANY` records for the target domain.        |
| `nslookup -query=TXT $TARGET`      | Identify the `TXT` records for the target domain.    |
| `dig txt $TARGET @<nameserver/IP>` | Identify the `TXT` records for the target domain.    |
| `nslookup -query=MX $TARGET`       | Identify the `MX` records for the target domain.     |
| `dig mx $TARGET @<nameserver/IP>`  | Identify the `MX` records for the target domain.     |
| {% endtab %}                       |                                                      |
| {% endtabs %}                      |                                                      |
