DNSmasq. 启动后 出现报错:dnsmasq: failed to create listening socket for 192.168.50.103: Permission denied

用brew insatll dnsmasq

配置完后

启动时:
Warning: Taking root:admin ownership of some dnsmasq paths:
/usr/local/Cellar/dnsmasq/2.85/sbin
/usr/local/Cellar/dnsmasq/2.85/sbin/dnsmasq
/usr/local/opt/dnsmasq
/usr/local/opt/dnsmasq/sbin
/usr/local/var/homebrew/linked/dnsmasq
This will require manual removal of these paths using sudo rm on
brew upgrade/reinstall/uninstall.
==> Successfully started dnsmasq (label: homebrew.mxcl.dnsmasq)

dig test.com

; <<>> DiG 9.10.6 <<>> test.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9536
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test.com.            IN    A

;; ANSWER SECTION:
test.com.        0    IN    A    192.168.50.103
test.com.        0    IN    A    127.0.0.1

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Aug 28 01:24:07 CST 2021
;; MSG SIZE  rcvd: 69

ping test.com :

PING test.com (192.168.50.103): 56 data bytes
64 bytes from 192.168.50.103: icmp_seq=0 ttl=64 time=0.104 ms
64 bytes from 192.168.50.103: icmp_seq=1 ttl=64 time=0.259 ms
64 bytes from 192.168.50.103: icmp_seq=2 ttl=64 time=0.228 ms
64 bytes from 192.168.50.103: icmp_seq=3 ttl=64 time=0.154 ms
64 bytes from 192.168.50.103: icmp_seq=4 ttl=64 time=0.135 ms
64 bytes from 192.168.50.103: icmp_seq=5 ttl=64 time=0.139 ms
64 bytes from 192.168.50.103: icmp_seq=6 ttl=64 time=0.239 ms
^C

但在使用brew services list 时会出现:
Name Status User Plist
dnsmasq unknown root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

使用dnsmasq -test 命令出现:
dnsmasq: failed to create listening socket for 192.168.50.103: Permission denied

请教下这些错误如何解决?

sudo dnsmasp -test

使用brew services list 时会出现:
Name Status User Plist
dnsmasq unknown root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

上面这个问题,也是命令不熟引起,需要在 sudo brew services list 才可以。 给各位添麻烦了!

使用dnsmasq -test 命令出现:
dnsmasq: failed to create listening socket for 192.168.50.103: Permission denied

sudo dnsmasq --test 或者 dnsmasq --test 都可以。