Created
November 24, 2016 12:06
-
-
Save zengxs/02be16d7d6d71a718dc4b308ccda8623 to your computer and use it in GitHub Desktop.
Systemd unit file for chinadns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chinadns 可执行文件放到
/opt/chinadns/chinadns
路由表信息放到
/opt/chinadns/chnroute.txt
复制该 service 脚本到
/lib/systemd/system/
目录执行
systemctl start chinadns.service
即可启动