$dns » History » Revision 3
Revision 2 (Per Amundsen, 11/14/2015 06:26 AM) → Revision 3/4 (Per Amundsen, 11/14/2015 06:27 AM)
_Added in 1.9.0_ *$dns(N)* Returns the IP address that was resolved during a [[on DNS]] [[Scripting_Events|event]]. See also [[/dns]], [[/dns]] [[on DNS]]. *Parameters* N - If N = 0, returns number of associated IP addresses, otherwise the Nth IP address. *Properties* .nick - Returns the nick if [[/dns]] was used on a nick. .addr - Returns the resolved hostname. .ip - Returns the resolved Ip address. *Example* <pre> ; Lookup a nick /dns nick ; Lookup a hostname /dns google.com ; Lookup a IP address. /dns 8.8.8.8 ; Print the results from the lookups. on *:DNS:{ var %n = $dns(0) echo 4 Found %n addresses while (%n > 0) { echo 4 dns: $dns(%n) nick: $dns(%n).nick addr: $dns(%n).addr ip: $dns(%n).ip dec %n } } </pre>