SHARE
TWEET

Untitled

a guest Oct 14th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import (
  4.     "bufio"
  5.     "fmt"
  6.     "io"
  7.     "net"
  8.     "os"
  9.     "strings"
  10. )
  11.  
  12. func dns(domain string) {
  13.     ns, err := net.LookupHost(domain)
  14.     if err != nil {
  15.         //fmt.Fprintf(os.Stderr, "Err: %s", err.Error())
  16.     } else {
  17.         fmt.Print(domain)
  18.     }
  19.  
  20.     for _, n := range ns {
  21.         fmt.Fprintf(os.Stdout, "--%s\n", n)
  22.     }
  23. }
  24. func main() {
  25.     f, err := os.Open("dns.txt")
  26.     if err != nil {
  27.         fmt.Print(err)
  28.     }
  29.     defer f.Close()
  30.     buf := bufio.NewReader(f)
  31.     for {
  32.         line, err := buf.ReadString('\n')
  33.         line = strings.TrimSpace(line)
  34.         if err != nil {
  35.             if err == io.EOF {
  36.                 break
  37.             }
  38.             fmt.Print(err)
  39.         }
  40.         domain := line + "lenovo.com.cn"
  41.         go dns(domain)
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top