The Domain Name System (DNS) is best known as the way domain names are converted into IP addresses that clients connect to, but there are many other uses for DNS. Read on to learn more.
Information about resources in a domain are stored as Resource Records inside a DNS zone. There are many different types of Resource Records.
Type | Description |
A | IPv4 addresses |
AAAA | IPv6 addresses |
CNAME | Configures a domain or subdomain as an alias for another domain or subdomain |
MX | Specifies incoming mail servers for the domain or subdomain |
NS | Specifies the secondary nameservers to be used for the zone or subdomain |
PTR | Pointer record that specifies the reverse DNS hostname of an IP address |
SOA | Statement of Authority – contains multiple values separated by commas
|
SRV | A service record that specifies a hostname and port for a particular service – frequently used for chat VoIP services, _service._proto.name. TTL class type of record priority weight port target. A XMPP chat service on server.example.com would need a SRV record like _xmpp._tcp.example.com. 86400 IN SRV 10 5 5223 server.example.com. For more information on SRV resource records, see this documentation at Cloudflare. |
TXT | Arbitrary text strings. Used by standards like SPF, DKIM, and DMARC to publish information about a domain for email authentication. Also used by various services to validate domain ownership. |
DNS zones are hosted in nameservers specified by the domain owner. The nameservers may be hosted by the domain registrar, owner, or a third-party service. Administrators/owners of a domain can delegate a control of a subdomain to another nameserver using NS records, allowing someone else to manage records for that subdomain and anything below as a separate DNS zone. For example, the root zone of example.com is com.
The resource records for a given domain can be found by using a DNS query tool like dig to query for each of the various record types.
dig SOA example.com dig NS example.com dig A example.com dig AAAA example.com dig MX example.com dig TXT example.com dig SRV example.com
You can also query subdomains, but you must know the name of the subdomain (or use a passive DNS service to learn about historical queries for a domain). www is a commonly-used subdomain, so that is a good one to try.
dig SOA www.example.com dig NS www.example.com dig A www.example.com dig AAAA www.example.com dig MX www.example.com dig TXT www.example.com dig SRV www.example.com
Here are the resource records for example.com and www.example.com:
rrname | rrtype | rdata |
example.com. | A | 93.184.216.34 |
example.com. | NS | a.iana-servers.net. b.iana-servers.net. |
example.com. | SOA | ns.icann.org. noc.dns.icann.org. 2021022340 7200 3600 1209600 3600 |
example.com. | MX | 0 . |
example.com. | TXT | “v=spf1 -all” “8j5nfqld20zpcyr8xjw0ydcfq9rk8hgm” |
example.com. | AAAA | 2606:2800:220:1:248:1893:25c8:1946 |
www.example.com. | A | 93.184.216.34 |
www.example.com. | TXT | “v=spf1 -all” |
www.example.com. | AAAA | 2606:2800:220:1:248:1893:25c8:1946 |
Based on these results, we know the following about the DNS zone for example.com:
If the administrator of example.com wanted to allow a contractor to control the records of contractor.example.com and below, the administrator would add a NS resource record named contractor.example.com, and set the value/rdata to the nameservers of the contractor.
This post was last modified on May 17, 2021 12:30 pm