1
JackBlack2006 2016-05-23 19:56:44 +08:00
sudo brew services start pdnsd
|
2
vonsy OP @JackBlack2006 不行,使用 brew install pdnsd 重新装了也不行
sys-MacBook-Pro:~ fsy$ sudo brew services start pdnsd Password: Error: Formula `pdnsd` not installed, #plist not implemented or no plist file found sys-MacBook-Pro:~ fsy$ sudo brew services list Name Status User Plist dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist sys-MacBook-Pro:~ fsy$ |
3
JackBlack2006 2016-05-23 22:12:48 +08:00
你不是装了 dnsmasq 么,这一个够用了吧
|
4
JackBlack2006 2016-05-23 22:14:02 +08:00
贴 conf
没准你忘记改 pdnsd 端口了 |
5
vonsy OP @JackBlack2006 dnsmasq 不支持 tcp 请求. 我想系统使用 dnsmasq(端口 53), dnsmasq 上游是 pdnsd(端口 1053)
现在就是 sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.pdnsd.plist 无法启动 eblt 手工直接 /usr/local/sbin/pdnsd --daemon 服务能启动,也能正常使用的. /usr/local/etc/pdnsd.conf global { # debug = on; # /var/pdnsd/pdnsd.debug perm_cache=10240; # 1MB cache cache_dir="/usr/local/var/cache/pdnsd"; #run_as="nobody"; paranoid=on; par_queries=5; server_port = 1053; server_ip = 127.0.0.1; status_ctl = on; query_method=tcp_only; # gfw don't pollute TCP query now min_ttl=2h; max_ttl=1w; timeout=6; # https://wiki.archlinux.org/index.php/Pdnsd#Performance_Settings_For_Home_Broadband_Users neg_rrs_pol=on; } server { label="Google Public DNS"; ip=8.8.8.8,8.8.4.4; # root_server = on; #uptest = ping; uptest = none; proxy_only=on; purge_cache=off; } source { owner=localhost; # serve_aliases=on; file="/etc/hosts"; } rr { name=localhost; reverse=on; a=127.0.0.1; owner=localhost; soa=localhost,root.localhost,42,86400,900,86400,86400; } |
6
Daniel65536 2016-05-24 00:32:49 +08:00
纯粹是 launchctl 的 plist 写错了,去读 https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html
两个 plist 都没指定什么时候执行 pdnsd ,你 service 启动时根本屁事都不会做。第二个 plist 用了 KeepAlive 就不要加--daemon ,否则启动了 pdnsd 之后 fork 两次成为 daemon , launchd 启动的 pdnsd 自己挂掉, KeepAlive 项会尝试再次启动 pdnsd 然后不断报错。 正确的 plist 照着 dnsmasq 的改就好: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>homebrew.mxcl. pdnsd </string> <key>ProgramArguments</key> <array> <string>/usr/local/sbin/pdnsd </string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist> |
7
tony1016 2016-05-24 09:22:37 +08:00
@JackBlack2006 brew 竟然还有这个功能,学习了
|