Difference between revisions of "On dns"

From Scriptwiki
Jump to: navigation, search
m (Created page with "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 nicknam...")
 
m (Added category + see also $raddress)
 
Line 21: Line 21:
 
* [[dns]]
 
* [[dns]]
 
* [[$dns]]
 
* [[$dns]]
 +
* [[$raddress]]
 +
 +
[[Category:Events]]

Latest revision as of 21:03, 24 February 2011

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