Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gythialy/77dc2c3db41d4081320d to your computer and use it in GitHub Desktop.
Save gythialy/77dc2c3db41d4081320d to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.shadowsocks.chinadns</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/chinadns</string>
<string>-c</string>
<string>/Users/gythialy/opt/chnroute.txt</string>
<string>-p</string>
<string>5300</string>
</array>
<key>UserName</key>
<string>root</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
  1. Install chinadns pip install chinadns

  2. Move the binary to /usr/sbin sudo mv /usr/local/bin/chinadns /usr/sbin/

  3. Download this plist curl https://gist.githubusercontent.com/gythialy/77dc2c3db41d4081320d/raw/3bac5e11be125bb411f4b85ec8ce6a49c4c3ae7e/com.shadowsocks.chinadns.plist -O sudo mv com.shadowsocks.chinadns.plist /Library/LaunchDaemons/

  4. Change ownership sudo chown root:wheel /Library/LaunchDaemons/com.shadowsocks.chinadns.plist sudo chmod +x /Library/LaunchDaemons/com.shadowsocks.chinadns.plist

  5. Launch ChinaDNS: sudo launchctl load com.shadowsocks.chinadns.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment