$dns

From Scriptwiki
Jump to: navigation, search

Returns the address that was resolved and any associated IP address. Can be used only in the On dns event.

$dns(N)

$dns returns the number of resolved address if N is 0 (zero).

$dns can have the following properties:

Property Meaning
nick if a user was queried to be resolved, returns its nick
addr returns the resolved address
ip returns the IP of the resolved address

Example

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 ; $iif($dns(%x).nick, Nick = $dns(%x).nick)
    inc %x
  }
}

This will echo all the resolved addresses.

See Also