mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-23 16:43:29 +01:00
4a1aee1ae0
* Add routes (client and server) to status command * Add DNS servers to status output
38 lines
830 B
Go
38 lines
830 B
Go
//go:build !ios
|
|
|
|
package dns
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"time"
|
|
|
|
"github.com/miekg/dns"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/peer"
|
|
)
|
|
|
|
type upstreamResolverNonIOS struct {
|
|
*upstreamResolverBase
|
|
}
|
|
|
|
func newUpstreamResolver(
|
|
ctx context.Context,
|
|
_ string,
|
|
_ net.IP,
|
|
_ *net.IPNet,
|
|
statusRecorder *peer.Status,
|
|
) (*upstreamResolverNonIOS, error) {
|
|
upstreamResolverBase := newUpstreamResolverBase(ctx, statusRecorder)
|
|
nonIOS := &upstreamResolverNonIOS{
|
|
upstreamResolverBase: upstreamResolverBase,
|
|
}
|
|
upstreamResolverBase.upstreamClient = nonIOS
|
|
return nonIOS, nil
|
|
}
|
|
|
|
func (u *upstreamResolverNonIOS) exchange(ctx context.Context, upstream string, r *dns.Msg) (rm *dns.Msg, t time.Duration, err error) {
|
|
upstreamExchangeClient := &dns.Client{}
|
|
return upstreamExchangeClient.ExchangeContext(ctx, r, upstream)
|
|
}
|