mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-29 07:16:29 -04:00
send IPv6 query only to supported server.
This commit is contained in:
parent
878d412c6a
commit
8fb69fc2b6
@ -22,6 +22,12 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
pseudoDestination = net.UDPDestination(net.LocalHostIP, net.Port(53))
|
pseudoDestination = net.UDPDestination(net.LocalHostIP, net.Port(53))
|
||||||
|
|
||||||
|
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 {
|
type ARecord struct {
|
||||||
@ -150,12 +156,14 @@ func (v *UDPNameServer) BuildQueryA(domain string, id uint16) *buf.Buffer {
|
|||||||
Name: dns.Fqdn(domain),
|
Name: dns.Fqdn(domain),
|
||||||
Qtype: dns.TypeA,
|
Qtype: dns.TypeA,
|
||||||
Qclass: dns.ClassINET,
|
Qclass: dns.ClassINET,
|
||||||
},
|
}}
|
||||||
{
|
if multiQuestionDns[v.address.Address] {
|
||||||
|
msg.Question = append(msg.Question, dns.Question{
|
||||||
Name: dns.Fqdn(domain),
|
Name: dns.Fqdn(domain),
|
||||||
Qtype: dns.TypeAAAA,
|
Qtype: dns.TypeAAAA,
|
||||||
Qclass: dns.ClassINET,
|
Qclass: dns.ClassINET,
|
||||||
}}
|
})
|
||||||
|
}
|
||||||
|
|
||||||
buffer := buf.New()
|
buffer := buf.New()
|
||||||
common.Must(buffer.Reset(func(b []byte) (int, error) {
|
common.Must(buffer.Reset(func(b []byte) (int, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user