-
Notifications
You must be signed in to change notification settings - Fork 48
/
whois.go
60 lines (46 loc) · 989 Bytes
/
whois.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
//"fmt"
//"net"
//"time"
)
import (
//"os"
//"time"
//"strconv"
"net"
"fmt"
"time"
)
func main() {
//conn, err := net.DialTimeout("tcp", ":43", 30*time.Second)
conn, err := net.Dial("tcp", "whois.ai:43")
if err != nil {
fmt.Printf("connect error :%s \n", err.Error())
//wgLogFile.Lock()
//fileLog.WriteString(`connect error` + err.Error())
//wgLogFile.Lock()
}
if conn == nil {
fmt.Printf("connect error")
//wgLogFile.Lock()
//fileLog.WriteString(`connect error`)
//wgLogFile.Lock()
return
}
defer conn.Close()
//fmt.Printf("connect ok \n")
//wgLogFile.Lock()
//fileLog.WriteString(`connect ok`)
//wgLogFile.Lock()
//fmt.Printf(domain + "\r\n")
fmt.Fprintf(conn, "4444444444.ai\r\n")
time.Sleep(time.Second)
var buf = make([]byte, 65536)
n, err := conn.Read(buf)
if err == nil {
newstr := string(buf[0 : n-1])
//newstr = string(buf)
fmt.Printf(newstr)
}
}