Skip to content

Instantly share code, notes, and snippets.

@tamx
Created May 19, 2014 06:52
Show Gist options
  • Save tamx/5109d6016c8201f87a62 to your computer and use it in GitHub Desktop.
Save tamx/5109d6016c8201f87a62 to your computer and use it in GitHub Desktop.
package main
import (
"net"
)
func main() {
/*
tam@wheezy-go:~$ nslookup thinpc-chrome
Server: 192.168.7.1
Address: 192.168.7.1#53
Non-authoritative answer:
Name: thinpc-chrome.mshome.net
Address: 192.168.7.143
*/
// 192.168.7.143(thinpc-chrome) -> OK
_, err := net.Dial("tcp4", "192.168.7.143:3389")
if err != nil {
println("Error1 Connect", err.Error())
}
_, err = net.Dial("tcp4", "thinpc-chrome.mshome.net:3389")
if err != nil {
println("Error2 Connect", err.Error())
}
// -> Error2 Connect lookup thinpc-chrome.mshome.net: No address associated with hostname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment