1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 04:25:44 -05:00
Files
v2fly/app/dns/nameserver.go

33 lines
563 B
Go
Raw Normal View History

2017-12-19 23:55:09 +01:00
package dns
2016-05-15 23:09:28 -07:00
import (
"context"
2016-05-15 23:09:28 -07:00
"time"
"v2ray.com/core/common/net"
2016-05-15 23:09:28 -07:00
)
2016-06-01 22:09:24 +02:00
var (
2017-11-19 21:43:20 +01:00
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,
}
2016-06-01 22:09:24 +02:00
)
2016-05-15 23:09:28 -07:00
type ARecord struct {
IPs []net.IP
Expire time.Time
}
type NameServer interface {
2018-06-26 15:04:47 +02:00
QueryIP(ctx context.Context, domain string) ([]net.IP, error)
2016-05-15 23:09:28 -07:00
}
2016-05-16 09:05:01 -07:00
type LocalNameServer struct {
}
2018-06-26 15:04:47 +02:00
func (*LocalNameServer) QueryIP(ctx context.Context, domain string) ([]net.IP, error) {
return net.LookupIP(domain)
2016-05-16 09:05:01 -07:00
}