tools.go_host
Yohn Y.
2020-12-22
0:520c8621f5ee
Go to Latest
tools.go_host/host.go
.. init
8 idna "golang.org/x/net/idna"
11 func say_err(msg interface{}) {
12 _, err := fmt.Fprintf(os.Stderr, "ERROR: %s\n", msg)
22 say_err("Need hostname or IP as argument")
27 ip := net.ParseIP(arg)
30 res, err := net.LookupAddr(ip.String())
35 for _, i := range res {
40 hostname, err := idna.ToASCII(arg)
45 res, err := net.LookupHost(hostname)
50 for _, i := range res {