From 1d625fc64373355e204ba143e5ac7dfcdb152890 Mon Sep 17 00:00:00 2001 From: AsenHu <78863300+AsenHu@users.noreply.github.com> Date: Sat, 3 Jun 2023 13:45:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=20DNS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 允许用户通过设置全局变量 WireGuard_Interface_DNS_IPv6 和 WireGuard_Interface_DNS_IPv4 来自定义 DNS 服务器 --- warp.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/warp.sh b/warp.sh index 46f90ab..2b80769 100755 --- a/warp.sh +++ b/warp.sh @@ -83,10 +83,20 @@ WGCF_ProfilePath="${WGCF_ProfileDir}/${WGCF_Profile}" WireGuard_Interface='wgcf' WireGuard_ConfPath="/etc/wireguard/${WireGuard_Interface}.conf" -WireGuard_Interface_DNS_IPv4='8.8.8.8,8.8.4.4' -WireGuard_Interface_DNS_IPv6='2001:4860:4860::8888,2001:4860:4860::8844' +# Set DNS +if [ ! ${WireGuard_Interface_DNS_IPv4} ] +then + WireGuard_Interface_DNS_IPv4='1.1.1.1,8.8.8.8' +fi + +if [ ! ${WireGuard_Interface_DNS_IPv6} ] +then + WireGuard_Interface_DNS_IPv6='2606:4700:4700::1111,2001:4860:4860::8888' +fi + WireGuard_Interface_DNS_46="${WireGuard_Interface_DNS_IPv4},${WireGuard_Interface_DNS_IPv6}" WireGuard_Interface_DNS_64="${WireGuard_Interface_DNS_IPv6},${WireGuard_Interface_DNS_IPv4}" +echo "You have configured the DNS to $WireGuard_Interface_DNS_46." WireGuard_Interface_Rule_table='51888' WireGuard_Interface_Rule_fwmark='51888' WireGuard_Interface_MTU='1280' From 68ea27fcaba1044b52ce2e18ff143afb7948aeb6 Mon Sep 17 00:00:00 2001 From: AsenHu <78863300+AsenHu@users.noreply.github.com> Date: Sat, 3 Jun 2023 13:51:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=BA=86=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E8=87=AA=E5=AE=9A=E4=B9=89=20DNS=20=E7=9A=84=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如题 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 279ae07..37b024e 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,16 @@ help Prints this message or the help of the given subcommand(s) menu Chinese special features menu ``` +### Configuring Custom DNS + +To configure custom DNS, set the environment variables `WireGuard_Interface_DNS_IPv4` and `WireGuard_Interface_DNS_IPv6`. + +```bash +export WireGuard_Interface_DNS_IPv4 = '1.1.1.1,8.8.8.8' +export WireGuard_Interface_DNS_IPv6 = '2606:4700:4700::1111,2001:4860:4860::8888' +bash <(curl -fsSL git.io/warp.sh) proxy +``` + ### Example - Install and automatically configure the Proxy Mode feature of the WARP client, enable the local loopback port 40000, and use an application that supports SOCKS5 to connect to this port.