On dns

From Scriptwiki
Revision as of 21:03, 24 February 2011 by NaNg (talk | contribs) (Added category + see also $raddress)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The on DNS event triggers when a /dns query either succeeds or fails.

on <level>:DNS:<commands>

Note that this will also be triggered if you try to /dns a nickname, and the nickname is not on IRC.

$address in this context is the address or IP which was queried to be resolved.

Examples

On *:Dns: {
  echo -ag Found $dns(0) addresses for $address ( $+ $raddress $+ )!
  var %x = 1
  while ($dns(%x)) {
    echo -ag DNS Resolve %x Address = $dns(%x).addr ; IP = $dns(%x).ip
    inc %x
  }
}

This will echo all the resolved addresses.

See Also