Created
April 12, 2022 06:31
-
-
Save notsobad/aa252de8d23cae9f265d743f1d041be0 to your computer and use it in GitHub Desktop.
Use dns-reverse-proxy to route dns request to different server by domain name.
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
#!/bin/bash | |
# Get dns-reverse-proxy from https://github.com/notsobad/dns-reverse-proxy | |
pushd /xxx/dns-reverse-proxy | |
LAN_DNS=`systemd-resolve --status | grep 'DNS Servers'|cut -d ':' -f2|xargs`:53 | |
echo "lan dns": $LAN_DNS | |
sudo ./dns-reverse-proxy\ | |
-address 0.0.0.0:53 \ | |
-default 114.114.114.114:53 \ | |
-route .baidu.com=https://dns.alidns.com \ | |
-route .aliyundrive.com=https://dns.alidns.com \ | |
-route .notsobad.com.=$LAN_DNS\ | |
-route .test.com.=$LAN_DNS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment