About
txt records are DNS record where any text value can be stored.
They are used for multiple purposes such as:
- Email authentication with
- SPF to list the server that sends email
- DKIM where the public key is stored to decrypt the email signature
- DMARC where the actions that should be taken on bad email are set.
- but also for domain ownership verification for instance:
- to become the postmaster on Search Console / Email such as https://postmaster.google.com/
Query
For instance, if we want to know:
- the TXT record of google.com
- on the nameserver ns2.google.com
you would DNS query the database record with nslookup and the following command:
nslookup -type=TXT google.com ns2.google.com