问题原文
原帖链接 · nyoatype · CC BY-SA 4.0
I'm trying to add CAA records to my DNS server that uses dnsmasq, but haven't bee successfull. The CAA helper site tells me to use "--dns-rr=sitename" -option, but I have no idea where to put them. I tried adding it to /etc/dnsmasq.conf which gave me a syntax error. I also tried using it in command line, but that just tries to start the dnsmasq daemon itself.
So, the question is, how can I add a CAA record to dnsmasq?
已采纳解答
原帖链接 · Patrick Mevzek · CC BY-SA 4.0
You need to use the dns-rr keyword in configuration file, or --dns-rr on the command-line. dns-rr|--dns-rr is indeed the way to put any arbitrary DNS content besides the type dnsmasq knows about like A, MX, PTR, etc.
Note its use in manual:
--dns-rr=<name>,<RR-number>,[<hex data>]
Return an arbitrary DNS Resource Record. The number is the type of the record (which is always in the C_IN class). The value of the record is given by the hex data, which may be of the form 01:23:45 or 01 23 45 or 012345 or any mixture of these.
Of course the name is the easy part, it will be typically your domain name.
So, you first need to find the "RR type number" for CAA records.
If you go to IANA registry on DNS RRtypes, and search for CAA you will see it is number 257. So 257 goes into the above RR-number part.
As for the hex-data part you need to take the content you wish to publish and encode it as hexadecimal data. Many tools can help you in that.
Alternatively, if you just go to https://sslmate.com/caa/, after filling out the form with all your details, you will see at bottom that it does everything for you and gives you exactly what you need to use in dnsmasq such as this example:
--dns-rr=example.com,257,000569737375653B
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
