Tag: DNS records

DNS TXT record explained

DNS TXT record

There are a lot of DNS record types, at least 50 out there! One of them is called DNS TXT record, and it has a variety of purposes. Yes, it is one simple text record, but it is widely used, so let us explain the TXT record.

TXT record explained

TXT record is a DNS record type that has text information designed for external to the domain sources. The text could be written for people, so it would be easy to read, has enough information and logically organized, or made for computers, and has a more technical format.

Usually, you will see, inside the TXT record, a piece of general information about the domain and an additional part for a particular type of validation.

What’s inside a DNS TXT record?

There are just a few fields that you can manage:

  • Host: Hostname/ domain name, for which we are creating the TXT record.
  • Type: TXT – the DNS record type.
  • TTL: Time, that this record is cached on the recursive server.
  • Points to: Here, you can put a different value, depending on the purpose you decide.

Why do you need a TXT record?

The TXT DNS record has multiple purposes and can work with different software, including various email verification methods for incoming and outgoing email servers:

  • SPF – Sender Policy Framework is a method for authentication of emails, checking which of the servers has the right to send emails for a domain and has different mechanisms in case of wrong sender parameters.
  • DKIM – DomainKeys Identified Mail. It is a cryptographic authentication method for signing mails and proving that they are coming from a particular domain.
  • DMARC – Domain-based Message Authentication Reporting and Conformance is a security mechanism that proves who the sender of an email is and lowers the number of spam messages.
  • Verification for software – Big companies like Microsoft (Office 365), Google and more, need you to add a TXT record in your DNS zone to prove it is yours. It combines the SPF and DKIM authentication and works with them.

How to probe TXT records

We will use Wikipedia.org for checking their TXT records, but you can just replace it with your domain name and see your TXT records.

Check TXT record on Windows

Open the Command Prompt. Press “Windows key + R”, the Run application will start, and there you can type “cmd”, and press the Enter button. Inside the Command Prompt, we will use the nslookup command.

nslookup -type=txt wikipedia.org

Check TXT record on Linux and macOS

On Linux and macOS, there are many ways that you can check the TXT DNS record. All of them will involve using the Terminal application, so please start it. 

Dig command on Linux and macOS

Dig command is one of the most powerful tools for performing dns queries and debug your dns configuration, for example – what are your current TXT records. Here are some examples how to check the TXT record for a domain name:

dig wikipedia.org TXT

or you can use a specific one to check the DMARC record:

dig _dmarc.wikipedia.org TXT

Host command on Linux and macOS

host -t txt wikipedia.org

Conclusion:

After this article, you should know what the TXT DNS record is, why does TXT record exist, how to check the TXT record so we can easily say, TXT record explained! 

What is Time To Live (TTL)?

Time To Live TTL

What is TTL?

Time To Live (TTL) sounds like a horror movie, but luckily it is not related to people. It is the value that shows how long the information should be kept in a particular device. There are many pieces of data that have their own TTL value. Here we will see DNS TTL and CDN TTL. 

When we are talking about DNS TTL, it is related to the time that the DNS resolvers must keep the DNS records in their cache. Each of the DNS records will have its TTL value. There are some with longer TTL because there is less chance that the value will change and others with shorter TTL value, where there are often changes. 

You can use these values as an orientation for your DNS records:

  • A and AAAA records – 2 hours (7200 seconds) is ok.
  • CNAME records – up to 12 hours (43200 seconds)
  • MX records – keep it as low. 1 hour (3600 seconds) is ok. 
  • TXT records – up to 12 hours (43200 seconds).

And about the CDN TTL, there we are talking about caching the whole content and how long should the cache servers keep the photos, videos, or whatever needs to be cached. 

When the TTL expires, the servers need to discard the current data that they have and make a new query to get the updated information from the primary servers. 

How does TTL work with DNS queries?

Talking about DNS requests, they are packets of data that also have TTL value. Imagine if they didn’t have such a parameter! The first-ever DNS query could still be around, going from server to server. 

So the TTL value of a DNS request is there to stop the perpetual search or answer and reduce pointless stress on the system. 

The value starts with a bigger number and gets dropped when it comes to zero by the routers. 

How to check the TTL value on Windows?

If you are a Windows user, you can use the Nslookup command and check a particular DNS record like – SOA, A, MX, AAAA, and more. Change the type with the one you want to see.

Start the Command Prompt as an administrator, and use this:

nslookup –types=soa yourdomainhere.com

How to check TTL value on Linux or macOS?

You have more options on Linux and macOS. You can use different commands through the Terminal application. 

The Dig command can show you different DNS records, and you can see their TTL value. This example will be with A DNS record.

dig a yourdomainname.com

You can also use the Host command in a very similar way:

host –a yourdomainname.com

This command will show you all of the visible DNS records with their TTL values.

Conclusion

The TTL value is a necessary part that limits the time a data is valid. It will show if the data is current or if it needs to be updated soon. It makes data updates easier.

 

Navigation