questions about DNS records

Hello! Here are some questions & answers. The goal isn't to get all the questions "right". Instead, the goal is to learn something! If you find a topic you're interested in learning more about, I'd encourage you to look it up and learn more.

what fields does a DNS record have?

name, value, TTL, type

Technically there's also a "class" field, but literally all DNS records have the same class these days ("internet"), so you should never need to set it.

are all the fields mandatory?


Sometimes they might be hidden from you (for example if you create a DNS record in a web interface, it might hide the TTL field and set it to a default value) but all the fields are mandatory.

What's an example of a valid value for the name field of a DNS record?

The name of a DNS record is a hostname. So is a valid name but bananas isn't.

What are 2 examples of valid values for the "type" field of a DNS record


Every DNS record has a type. For example, A records are used for IPv4 addresses.

What's the unit for the TTL field (minutes? seconds? milliseconds?)


So a TTL of 300 is 5 minutes.

Can a TTL be more than an hour?


the TTL field is a 32-bit integer, so technically you could have a TTL of over 50 years. Most TTLs are less than a week though.

What's the purpose of the TTL field of a DNS record?


It stands for "time to live" and it determins how long recursive DNS servers should cache the record for.

Can a DNS record have more than one value?


A DNS response can contain many DNS records, but each DNS record has only 1 value, 1 name, 1 TTL, and 1 type.

Is there a limit to the number of DNS records you can set?


DNS uses UDP and there is a limit to how many DNS records can be returned in a single UDP packet (about 25 A records), so for each combination of hostname / record type it's best to not have too many records.

What's an example of a valid value for an DNS record with type A?

Any IPv4 address! Different record types have different values though, for example TXT records are allowed to contain any string!

more reading