我想在本地dnsmasq中配置一些TXT记录,它运行在本地网络中的单板机和服务器DHCP和DNS上。
我使用它使我在家中的服务可以在与因特网相同的FQDN下访问,但在A记录中有本地的IPv4地址。
效果很好。
然而,我正在努力让dnsmasq解决TXT记录。在尝试并无法将所需的记录解析后,我将示例TXT记录从example.conf复制到了dnsmasq.conf中。
#Example zeroconf
txt-record=_http._tcp.example.com,name=value,paper=A4重新加载dnsmasq,然后尝试
dig _http._tcp.example.com TXT @192.168.2.15会产生一个空的结果。
然而,dnsmasq.log说:
Sep 29 21:59:07 dnsmasq[725]: query[TXT] _http._tcp.example.com from 192.168.2.111
Sep 29 21:59:07 dnsmasq[725]: forwarded _http._tcp.example.com to 12.23.45.57 我试图谷歌这个,但我发现所有的链接到example.conf或手册。
我读取了手册页和配置文件,但找不到任何配置开关,这似乎是TXT记录要在本地解析所必需的。有人成功了吗?
谢谢!
发布于 2022-02-19 11:17:47
我宁愿发表评论,但我的声誉不允许我这样做。但是,由于你的问题是Has anybody succeeded?,我想用我自己的经验来回答是可以的。
简单地说,是的,我成功了,正如你所做的那样:
Server侧(Raspbian "buster"):
br@idril:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
br@idril:~$ dnsmasq --version
Dnsmasq version 2.80 Copyright (c) 2000-2018 Simon Kelley
Compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
[...]
br@idril:~$ hostname -I
192.168.0.120
br@idril:~$ hostname -d
lan
br@idril:~$ grep ^txt /etc/dnsmasq.conf
txt-record=lan,"v=spf1 a -all"
txt-record=_http._tcp.lan,name=value,paper=A4
br@idril:~$ sudo systemctl restart dnsmasq.serviceClient侧(Ubuntu "impish") :
br@lorien:~$ lsb_release -a
LSB Version: security-11.1.0ubuntu3-noarch
Distributor ID: Ubuntu
Description: Ubuntu 21.10
Release: 21.10
Codename: impish
br@lorien:~$ hostname -d
lan
br@lorien:~$ dig +short TXT _http._tcp.lan @192.168.0.120
"name=value" "paper=A4"
br@lorien:~$ dig +short TXT lan @192.168.0.120
"v=spf1 a -all"https://unix.stackexchange.com/questions/612075
复制相似问题