Administrators chain Posted October 3, 2021 Administrators Report Share Posted October 3, 2021 # Cmd Resolve by Jeff Fisher (guppy@eggheads.org) bind dcc -|- resolve resolve_cmd bind dcc -|- dns resolve_cmd proc resolve_cmd {hand idx arg} { if {[scan $arg "%s" hostip] != 1} { global lastbind putidx $idx "Usage: $lastbind <host or ip>" } else { putidx $idx "Looking up $hostip ..." set hostip [split $hostip] dnslookup $hostip resolve_callback $idx $hostip } return 0 } proc resolve_callback {ip host status idx hostip} { if {![valididx $idx]} { return 0 } elseif {!$status} { putidx $idx "Unable to resolve $hostip" } elseif {[regexp -nocase -- $ip $hostip]} { putidx $idx "Resolved $ip to $host" } else { putidx $idx "Resolved $host to $ip" } putcmdlog "#[idx2hand $idx]# resolve $hostip" return 0 } loadhelp cmd_resolve.help Quote Link to comment Share on other sites More sharing options...