Skip to content

wiresocks: dns cleanups #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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