MCPcopy Index your code
hub / github.com/screego/server / parseDNS

Function parseDNS

config/ip.go:73–92  ·  view source on GitHub ↗
(dnsString string)

Source from the content-addressed store, hash-verified

71}
72
73func parseDNS(dnsString string) *ipdns.DNS {
74 var dns ipdns.DNS
75
76 parts := strings.SplitN(dnsString, "@", 2)
77
78 dns.Domain = parts[0]
79 dns.DNS = "system"
80 if len(parts) == 2 {
81 dns.DNS = parts[1]
82 dns.Resolver = &net.Resolver{
83 PreferGo: true,
84 Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
85 d := net.Dialer{Timeout: 10 * time.Second}
86 return d.DialContext(ctx, network, parts[1])
87 },
88 }
89 }
90
91 return &dns
92}

Callers 1

parseIPProviderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected