From 3cd95dfeb6c5f72f73cbb5f82ad384502bd2e7b4 Mon Sep 17 00:00:00 2001 From: Mark Pashmfouroush Date: Wed, 20 Mar 2024 11:06:34 +0000 Subject: [PATCH] wiresocks: dns cleanups Signed-off-by: Mark Pashmfouroush --- warp/account.go | 9 +++------ wiresocks/proxy.go | 1 - wiresocks/wiresocks.go | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/warp/account.go b/warp/account.go index e5808a8af..5b0b7d35d 100644 --- a/warp/account.go +++ b/warp/account.go @@ -25,8 +25,6 @@ const ( var ( identityFile = "wgcf-identity.json" profileFile = "wgcf-profile.ini" - dnsAddresses = []string{"8.8.8.8", "8.8.4.4"} - dc = 0 ) var ( @@ -474,10 +472,9 @@ func getWireguardConfig(privateKey, address1, address2, publicKey, endpoint stri buffer.WriteString("[Interface]\n") buffer.WriteString(fmt.Sprintf("PrivateKey = %s\n", privateKey)) - buffer.WriteString(fmt.Sprintf("DNS = %s\n", dnsAddresses[dc%len(dnsAddresses)])) - dc++ - buffer.WriteString(fmt.Sprintf("Address = %s\n", address1+"/24")) - buffer.WriteString(fmt.Sprintf("Address = %s\n", address2+"/128")) + buffer.WriteString("DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001, 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888, 2001:4860:4860::8844, 9.9.9.9, 149.112.112.112, 2620:fe::fe, 2620:fe::9\n") + buffer.WriteString(fmt.Sprintf("Address = %s/24\n", address1)) + buffer.WriteString(fmt.Sprintf("Address = %s/128\n", address2)) buffer.WriteString("[Peer]\n") buffer.WriteString(fmt.Sprintf("PublicKey = %s\n", publicKey)) diff --git a/wiresocks/proxy.go b/wiresocks/proxy.go index 1b5fdf186..8b9d7bcb6 100644 --- a/wiresocks/proxy.go +++ b/wiresocks/proxy.go @@ -16,7 +16,6 @@ import ( // VirtualTun stores a reference to netstack network and DNS configuration type VirtualTun struct { Tnet *netstack.Net - SystemDNS bool Logger *slog.Logger Dev *device.Device Ctx context.Context diff --git a/wiresocks/wiresocks.go b/wiresocks/wiresocks.go index 75f5d641f..b75d4acd4 100644 --- a/wiresocks/wiresocks.go +++ b/wiresocks/wiresocks.go @@ -47,7 +47,6 @@ func StartWireguard(ctx context.Context, l *slog.Logger, conf *Configuration) (* return &VirtualTun{ Tnet: tnet, - SystemDNS: len(conf.Interface.DNS) == 0, Logger: l.With("subsystem", "vtun"), Dev: dev, Ctx: ctx,