Skip to content

Commit

Permalink
fix!: override DNS manually
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Apr 17, 2024
1 parent 4ca3435 commit 6dfb180
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions protocol/messenger_mailserver_cycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math"
"math/big"
"net"
"runtime"
"sort"
"strings"
Expand Down Expand Up @@ -219,6 +220,19 @@ type SortedMailserver struct {
}

func (m *Messenger) findNewMailserver() error {
// we have to override DNS manually because of https://github.com/status-im/status-mobile/issues/19581
const bootstrapDNS = "8.8.8.8:53"
var dialer net.Dialer
net.DefaultResolver = &net.Resolver{
PreferGo: false,
Dial: func(context context.Context, _, _ string) (net.Conn, error) {
conn, err := dialer.DialContext(context, "udp", bootstrapDNS)
if err != nil {
return nil, err
}
return conn, nil
},
}
pinnedMailserver, err := m.getPinnedMailserver()
if err != nil {
m.logger.Error("Could not obtain the pinned mailserver", zap.Error(err))
Expand Down

0 comments on commit 6dfb180

Please sign in to comment.