dnsmasq - 在苹果硅M1上出现服务状态问题

6

开始了。正在运行。但状态未知。

$ brew services list
Name Status User Plist
dnsmasq unknown root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

$ ping test90.local
PING test90.local (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.059 ms

$ sudo lsof -nP -iUDP | grep :53
mDNSRespo 208 _mdnsresponder 6u IPv4 0x4316bcf762302a5 0t0 UDP *:5353
mDNSRespo 208 _mdnsresponder 7u IPv6 0x4316bcf7622d70d 0t0 UDP *:5353
Commander 5611 sbaczyk 24u IPv4 0x4316bcf7475f9ed 0t0 UDP *:53671
dnsmasq 19828 nobody 4u IPv4 0x4316bcf7622f705 0t0 UDP 10.0.0.222:53
dnsmasq 19828 nobody 6u IPv4 0x4316bcf7622ffbd 0t0 UDP 127.0.0.1:53
dnsmasq 19828 nobody 8u IPv6 0x4316bcf7622d13d 0t0 UDP [fe80:10::9f5:a4eb:80c7:478a]:53
dnsmasq 19828 nobody 10u IPv6 0x4316bcf7622e87d 0t0 UDP [fe80:f::c6d6:4b39:3453:5eb0]:53
dnsmasq 19828 nobody 12u IPv6 0x4316bcf7622ee4d 0t0 UDP [fe80:e::604c:88ff:feb3:f84d]:53
dnsmasq 19828 nobody 14u IPv6 0x4316bcf7622d9f5 0t0 UDP [fe80:d::604c:88ff:feb3:f84d]:53
dnsmasq 19828 nobody 16u IPv6 0x4316bcf7616a87d 0t0 UDP [fe80️:140c:6b55:cf47:9a25]:53
dnsmasq 19828 nobody 18u IPv6 0x4316bcf76169cdd 0t0 UDP [fe80:5::1c00:62ff:fe3c:4c68]:53
dnsmasq 19828 nobody 20u IPv6 0x4316bcf7616b41d 0t0 UDP [fe80:4::1c00:62ff:fe3c:4c69]:53
dnsmasq 19828 nobody 22u IPv6 0x4316bcf7616ab65 0t0 UDP [fe80:1::1]:53
dnsmasq 19828 nobody 24u IPv6 0x4316bcf7616ae4d 0t0 UDP [::1]:53

我使用以下命令执行了安装

brew install dnsmasq
echo 'address=/.local/127.0.0.1' > /opt/homebrew/etc/dnsmasq.conf
sudo brew services start dnsmasq
brew services list

一些调试信息。

$ brew config
HOMEBREW_VERSION: 3.0.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: ed87211daa83982a6136e14d181a1550b46a0f17
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 02df6b76b81fa4e5ca13d3c7f4336d9a93c776e1
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.2.3-arm64
CLT: 12.4.0.0.1.1610135815
Xcode: N/A
Rosetta 2: false

% brew doctor
Your system is ready to brew.

我还需要检查什么吗? 如果能正确显示该状态,那就更好了。


我花了好几个小时在尝试让dnsmasq在本地安装的brew上运行。对我来说,问题在于不知道配置文件在哪里。感谢您指出它位于/opt/homebrew/etc/dnsmasq.conf。 - flashjpr
在你的例子中,你正在用这一行代码覆盖整个配置文件:echo 'address=/.local/127.0.0.1' > /opt/homebrew/etc/dnsmasq.conf。 - OpenGears
1个回答

11

这是因为你将dnsmasq作为超级用户运行。 运行sudo brew services list,你将看到状态。


3
只有超级用户才能在53端口上运行服务。 - sb84

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接