chore: try use domain mapping when normal dns

This commit is contained in:
Skyxim 2023-03-12 14:50:21 +08:00
parent 6cee7213c4
commit d0b95e91f5

View File

@ -210,6 +210,9 @@ func preHandleMetadata(metadata *C.Metadata) error {
} else if resolver.IsFakeIP(metadata.DstIP) {
return fmt.Errorf("fake DNS record %s missing", metadata.DstIP)
}
} else if node, ok := resolver.DefaultHosts.Search(metadata.Host, true); ok {
// try use domain mapping
metadata.Host = node.Domain
}
return nil