1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 23:36:25 -04:00
v2fly/app/dns/nameserver.go
2018-06-26 15:04:47 +02:00

33 lines
563 B
Go

package dns
import (
"context"
"time"
"v2ray.com/core/common/net"
)
var (
multiQuestionDNS = map[net.Address]bool{
net.IPAddress([]byte{8, 8, 8, 8}): true,
net.IPAddress([]byte{8, 8, 4, 4}): true,
net.IPAddress([]byte{9, 9, 9, 9}): true,
}
)
type ARecord struct {
IPs []net.IP
Expire time.Time
}
type NameServer interface {
QueryIP(ctx context.Context, domain string) ([]net.IP, error)
}
type LocalNameServer struct {
}
func (*LocalNameServer) QueryIP(ctx context.Context, domain string) ([]net.IP, error) {
return net.LookupIP(domain)
}