Skip to content

Instantly share code, notes, and snippets.

@zengxs
Created November 24, 2016 12:06
Show Gist options
  • Save zengxs/02be16d7d6d71a718dc4b308ccda8623 to your computer and use it in GitHub Desktop.
Save zengxs/02be16d7d6d71a718dc4b308ccda8623 to your computer and use it in GitHub Desktop.
Systemd unit file for chinadns
# Systemd unit file for chinadns
[Unit]
Description=Protect yourself against DNS poisoning in China
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/opt/chinadns/chinadns -b 0.0.0.0 -p 5353 -c /opt/chinadns/chnroute.txt -s "8.8.8.8:53,8.8.4.4:53"
ExecStop=/bin/kill -15 $MAINPID
User=nobody
Group=nobody
[Install]
WantedBy=multi-user.target
@zengxs
Copy link
Author

zengxs commented Nov 24, 2016

chinadns 可执行文件放到 /opt/chinadns/chinadns
路由表信息放到 /opt/chinadns/chnroute.txt

复制该 service 脚本到 /lib/systemd/system/ 目录
执行 systemctl start chinadns.service 即可启动

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