Skip to content

Commit

Permalink
wiresocks: dns cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Pashmfouroush <[email protected]>
  • Loading branch information
markpash committed Mar 20, 2024
1 parent efe8b5d commit 3cd95df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
9 changes: 3 additions & 6 deletions warp/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion wiresocks/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion wiresocks/wiresocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3cd95df

Please sign in to comment.