mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
chore: try use domain mapping when normal dns
This commit is contained in:
parent
6cee7213c4
commit
d0b95e91f5
|
@ -204,12 +204,15 @@ func preHandleMetadata(metadata *C.Metadata) error {
|
||||||
} else if node, ok := resolver.DefaultHosts.Search(host, false); ok {
|
} else if node, ok := resolver.DefaultHosts.Search(host, false); ok {
|
||||||
// redir-host should lookup the hosts
|
// redir-host should lookup the hosts
|
||||||
metadata.DstIP, _ = node.RandIP()
|
metadata.DstIP, _ = node.RandIP()
|
||||||
}else if node!=nil&&node.IsDomain{
|
} else if node != nil && node.IsDomain {
|
||||||
metadata.Host=node.Domain
|
metadata.Host = node.Domain
|
||||||
}
|
}
|
||||||
} else if resolver.IsFakeIP(metadata.DstIP) {
|
} else if resolver.IsFakeIP(metadata.DstIP) {
|
||||||
return fmt.Errorf("fake DNS record %s missing", 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
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user