From WikiChip
mirc/identifiers/$dns
< mirc‎ | identifiers
Revision as of 13:43, 1 July 2014 by Zmodem (talk | contribs) (Created $dns identifier)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The $dns identifier becomes filled and has the ability for reference whenever an ON DNS event occurs.

Synopsis

$dns(N)[.property]

Parameters

N Used to reference the resolved address, or total number of addresses

Properties

addr Return hostmask address
ip Return IP Address
nick Return nicknames resolved from a DNS lookup

Example

Echo to the active window the results of the DNS:

ON *:DNS:echo -a $iif($1,$iif($dns(1).nick,$v1 has been resolved to) Hostmask: $dns(1).addr IP: $dns(1).ip,Could not resolve DNS query.)

The above example makes use of multiple $iif identifiers to ensure that we get proper results, without unforeseen issues. The first surrounding $iif identifier checks to make sure any data has been returned. If no data is returned, then the DNS obviously failed; therefore, we have it return a statement which says that a resolution could not be made. If data has been returned, the second $iif identifier checks to see if a .nick value can be extracted from the $dns identifier. This is filled if a nickname was the target of the DNS request. If the nickname is filled, return the portion containing the nickname. If, however, the nickname is not present, present only the hostmask and IP address.

Compatibility

Added: mIRC v6.0

Added On: 03/02/2002

See Also