Fix dns sniff

This commit is contained in:
世界 2022-08-02 13:42:31 +08:00
parent 14b6200fd8
commit 37b11e614c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -52,7 +52,7 @@ func DomainNameQuery(ctx context.Context, packet []byte) (*adapter.InboundContex
return nil, os.ErrInvalid return nil, os.ErrInvalid
} }
domain := question.Name.String() domain := question.Name.String()
if question.Class == dnsmessage.ClassINET && (question.Type == dnsmessage.TypeA || question.Type == dnsmessage.TypeAAAA) && IsDomainName(domain) { if question.Class == dnsmessage.ClassINET && IsDomainName(domain) {
return &adapter.InboundContext{Protocol: C.ProtocolDNS /*, Domain: domain*/}, nil return &adapter.InboundContext{Protocol: C.ProtocolDNS /*, Domain: domain*/}, nil
} }
return nil, os.ErrInvalid return nil, os.ErrInvalid