大网数据广告活动
服务器运维问答

How to add a CAA record to dnsmasq?

· 52CE 我爱测

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/dns…

问题原文

原帖链接 · 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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。