How to add TXT record in Host File

Is is possible to add TXT record in local hostfile for local verification ?

I was looking for this for demo purpose on a Linux server.


The Linux hosts file is merely an IP -> hostname mapping. The operating systems is not querying itself for a DNS record, nor is it responding to its own query with a DNS record. It's responding with an IP address.

If you need a local host to respond with a specific DNS record type you'll need to install and configure DNS server software.