Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WhereIsDnsCmd = &cobra.Command{ Use: "whereisdns", Aliases: []string{ "dns", }, Short: "this command will help you check where is the dns server in provided CIDR", Run: func(cmd *cobra.Command, args []string) { ipNets, err := pkg.ParseStringToIPNet(command.Opts.Cidr) if err != nil { log.Warnf("ParseStringToIPNet failed: %v", err) return } s := false for _, ip := range pkg.ParseIPNetToIPs(ipNets) { serverAddr := fmt.Sprintf("%s:53", ip.String()) if checkdns(serverAddr) { s = true } serverAddr = fmt.Sprintf("%s:5353", ip.String()) if checkdns(serverAddr) { s = true } } if s { log.Warn("DNS Server Not Found!") } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.