Domain WHOIS Script - v1 - [BOTS]

By TMFKSOFT on Mar 11, 2012

This script simply allows you to WHOIS a domain via "@whois" in a channel, the whois results are then queried to the user who typed the command.

Current Features:

  • Supports redirects to other WHOIS Servers.


Follow the requirements (above) and simply load the script and its ready to go!

CAUTION! - This script is VERY spammy due to WHOIS Server TOS' this cannot be directly helped and could encourage users to spam you or the IRCD to disconnect you.

Known Bugs:

  • Can only whois one domain at a time you must wait till the domain has been whois'd before requesting another whois due to the laziness of variables.
  • Some whois servers have to be queried differently to get the correct results so you could end up with completely different results than what you expected.
  • If a domain does not exist nothing happens and the socket will most likely time out.

The TLD list was obtained from
The WHOIS Server explanation can be found here:

Leave your comments below!

; Domain whois script. For bots.

; Script by Thomas Edwards (2012)
; Feel free to use this snippet anywhere and to modify it yourself
; Please leave any credit for the orignal code if you use any of it.

on 1:TEXT:@whois*:#:{
  if ($2 == $null) {
    msg # Syntax: @whois
  else {
    set %domain $2
    set %tld $right($2,$calc(0 - $pos($2,.,$count($2,.))))
    set %dest $nick
    set %channel
    sockopen whois $+ $rand(1,99) $readini(whois.ini,tld,%tld) 43
    msg # WHOIS Lookup on: $2 - TLD: %tld - WHOIS Server: $readini(whois.ini,tld,%tld) - The WHOIS WILL be pm'd to $nick
on 1:sockopen:whois*:{
  sockwrite $sockname %domain $+ $crlf
on 1:sockread:whois*:{
  var %read
  sockread %read
  tokenize 32 %read
  if ($1 == Whois && $2 == Server:) {
    msg %dest 4[WHOIS] WHOIS Redirect. Redirecting to $3-
    whois_redir $3 %domain %dest
    sockclose $sockname
  else {
    msg %dest 3[WHOIS] %read
on 1:sockclose:whois*:{
  msg %dest 4[WHOIS] WHOIS END. Script by Thomas Edwards.
  unset %domain %dest %channel %tld
alias whois_redir {
  ; $1 = whois Server
  ; $2 = Domain Name
  set %domain $2
  set %dest $3
  sockopen whois $+ $rand(0,99) $1 43


Sign in to comment.
gasak   -  Jan 20, 2013
  • /sockopen: insufficient parameters (line 16, remote.ini)
Wade   -  Mar 12, 2012

Why not just filter out key information rather than sending the whole reply to the user, most of which is usually irrelevant information or formatting

GrimReaper   -  Mar 12, 2012

Look's good, Will have to test it out when I can be bothered to load my mIRC bot up.. One suggestion would be to add Flood Protection to stop possible "spamming" of the trigger, Thus causing you to Disconnect.

Only a suggestion tho. ;)

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.