MCPcopy Index your code
hub / github.com/foxcpp/maddy / LookupAddr

Function LookupAddr

framework/dns/resolver.go:47–53  ·  view source on GitHub ↗

LookupAddr is a convenience wrapper for Resolver.LookupAddr. It returns the first name with trailing dot stripped.

(ctx context.Context, r Resolver, ip net.IP)

Source from the content-addressed store, hash-verified

45//
46// It returns the first name with trailing dot stripped.
47func LookupAddr(ctx context.Context, r Resolver, ip net.IP) (string, error) {
48 names, err := r.LookupAddr(ctx, ip.String())
49 if err != nil || len(names) == 0 {
50 return "", err
51 }
52 return strings.TrimRight(names[0], "."), nil
53}
54
55func DefaultResolver() Resolver {
56 return net.DefaultResolver

Callers 1

fetchRDNSNameMethod · 0.92

Calls 2

LookupAddrMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected