2021-02-02 12:05:47 +01:00
|
|
|
package resolver
|
|
|
|
|
2021-06-08 19:40:17 +02:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net"
|
|
|
|
)
|
2021-02-02 12:05:47 +01:00
|
|
|
|
2021-06-08 19:40:17 +02:00
|
|
|
// SystemResolver is the system resolver.
|
|
|
|
type SystemResolver struct{}
|
|
|
|
|
|
|
|
// LookupHost implements Resolver.LookupHost.
|
|
|
|
func (r SystemResolver) LookupHost(ctx context.Context, hostname string) ([]string, error) {
|
|
|
|
return net.DefaultResolver.LookupHost(ctx, hostname)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Network implements Resolver.Network.
|
|
|
|
func (r SystemResolver) Network() string {
|
|
|
|
return "system"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Address implements Resolver.Address.
|
|
|
|
func (r SystemResolver) Address() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
// Default is the resolver we use by default.
|
|
|
|
var Default = SystemResolver{}
|
2021-02-02 12:05:47 +01:00
|
|
|
|
|
|
|
var _ Resolver = SystemResolver{}
|