I am currently following this tutorial. The author says we can add a TXT record on the local DNS resolver. But can I please know how do I do that?
How do I add a TXT or A record on the local server (127.0.0.1) using unbound
?
System - Ubuntu 18.04 (AWS EC2 Instance).
"The author says we can add a TXT record on the local DNS resolver." The author does not say that.
unbound
is a recursive validating resolver. Its purpose is just to resolve names, by querying other nameservers. It has no data itself on names, just what it retrieves.Adding a
TXT
record needs to happen on the authoritative nameservers for the zone, which by definition can not beunbound
.So you need to find out the nameservers for the zone where you want to add a
TXT
record for DKIM purposes, and change the zonefile there. Probably through some website or API offered by the provider currently managing your authoritative nameservers.Following the Unbound documentation, you can add a TXT record as local data.
An example of this: (adding both an A and a TXT record for a subdomain)
Please note that the outer quotes when adding a TXT record should be single quotes, since the TXT records itself is in double quotes.
In unbound configuration there is option to use 'local-zone' and 'local-data' sections. In server: section you specify something along the lines of:
Note the use of double quotes for TXT record itself and single quotes for local-data parameter
For more - see Unbound documentation.