Hacker News new | past | comments | ask | show | jobs | submit login

Not sure it's a bug, may be "a well-known limitation" (unknown to me) - https://inconshreveable.com/04-30-2014/cross-compiling-golan...

Have a Go: package main

  import (
          "fmt"
          "net"
          "os"
  )
  
  func main() {
          hostname := "feeds.feedburner.com"
          if len(os.Args) > 1 {
                  hostname = os.Args[1]
          }
          addr, err := net.LookupHost(hostname)
          if err != nil {
                  fmt.Printf("err: %v", err.Error())
          } else {
                  fmt.Printf("addr: %v", addr)
          }
  }
  
  set GOOS=linux
  set GOARCH=amd64
  set CGO_ENABLED=0



Hi,

I do not have windows box to crosscompile any longer. I did test go 1.4 rc2 with CGO_ENABLED=0, which builds a static binary, and it gives -

addr: [74.125.192.118 2607:f8b0:4001:c00::76]

Are you seeing different behavior? Please describe...I'll see if I can look into it.


Hi,

  $ ./dns-win-xc.bin
  err: lookup feeds.feedburner.com on [178.22.66.167]:53: no such host
  $ ./dns-lin.bin
  addr: [173.194.116.64 173.194.116.69 173.194.116.71 173.194.116.65 173.194.116.73 173.194.116.70 173.194.116.67 173.194.116.66 173.194.116.72 173.194.116.78 173.194.116.68 2a00:1450:400c:c0a::76]
Win 8.1, go1.3.3., Centos 7. There's a downvoter for some reason, maybe they have something to add...? Don't let me lead you astray - I haven't yet read that article I linked to, but a quick glimpse suggested to me that this isn't a bug.


I didn't(actually, can't) downvote. Before I dig further, can you try 1.4 rc2? We heavily refactored DNS this release.

Secondly, your dns-lin.bin, is that with go built with CGO_ENABLED=0? Ie...if you ldd both files, do they both claim to be statically linked?

If you'd like to continue by email, please click my username.

Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: