m (Bot: Adding a template (template:mIRC on event list)) |
m (Bot: Fixing links) |
||
Line 5: | Line 5: | ||
This event also fills the [[$iaddress identifier - mIRC|$iaddress]], [[$naddress - mIRC|$naddress]] and [[$raddress - mIRC|$raddress]] identifiers. These resolve to [[Ip address|IP Address]], [[Host address]], and resolved address, respectively. Although these identifiers work now, it is strongly advised that migration to using the [[$dns identifier - mIRC|$dns identifier]] is made. | This event also fills the [[$iaddress identifier - mIRC|$iaddress]], [[$naddress - mIRC|$naddress]] and [[$raddress - mIRC|$raddress]] identifiers. These resolve to [[Ip address|IP Address]], [[Host address]], and resolved address, respectively. Although these identifiers work now, it is strongly advised that migration to using the [[$dns identifier - mIRC|$dns identifier]] is made. | ||
− | The [[$nick identifier - mIRC|$nick identifier]] is filled as well. If | + | The [[$nick identifier - mIRC|$nick identifier]] is filled as well. If {{mIRC|/dns}} was performed on a nickname rather than an address, then [[$nick identifier - mIRC|$nick]] is filled with that nickname. Otherwise, [[$nick identifier - mIRC|$nick]] is filled with your own name. |
== Synopsis == | == Synopsis == |
Revision as of 19:08, 5 July 2014
The ON DNS event triggers when a DNS query either succeeds or fails, including when a user does not exist on the IRC server.
This event fills the $dns identifier with the address found for a user, as well as any addresses associated if DNS was performed on a host mask.
This event also fills the $iaddress, $naddress and $raddress identifiers. These resolve to IP Address, Host address, and resolved address, respectively. Although these identifiers work now, it is strongly advised that migration to using the $dns identifier is made.
The $nick identifier is filled as well. If /dns was performed on a nickname rather than an address, then $nick is filled with that nickname. Otherwise, $nick is filled with your own name.
Synopsis
ON <level>:DNS:<commands>
Parameters
<level>The level for the event to trigger.
<commands>The commands to be performed when the event listener's criteria is met.
Examples
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 v4.7
Added On: 09/12/96