Skip to content

Commit

Permalink
Fix: redir-host should lookup hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Apr 27, 2020
1 parent d1fd57c commit e537955
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func preHandleMetadata(metadata *C.Metadata) error {
metadata.AddrType = C.AtypDomainName
if enhancedMode.FakeIPEnabled() {
metadata.DstIP = nil
} else if node := resolver.DefaultHosts.Search(host); node != nil {
// redir-host should lookup the hosts
metadata.DstIP = node.Data.(net.IP)
}
} else if enhancedMode.IsFakeIP(metadata.DstIP) {
return fmt.Errorf("fake DNS record %s missing", metadata.DstIP)
Expand Down

0 comments on commit e537955

Please sign in to comment.