From WikiChip
Difference between revisions of "mirc/identifiers/$dns"
< mirc‎ | identifiers

m (Bot: Adding a template (template:mIRC identifier list))
m
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''$dns''' identifier becomes filled and has the ability for reference whenever an [[On dns - mIRC|ON DNS]] event occurs.
+
{{mirc title|$dns Identifier}}The '''$dns''' identifier becomes filled and has the ability for reference whenever an [[On dns - mIRC|ON DNS]] event occurs.
 +
 
  
 
== Synopsis ==
 
== Synopsis ==
Line 11: Line 12:
 
== Properties ==
 
== Properties ==
 
{{ArgsList
 
{{ArgsList
| addr | Return [[hostmask]] address
+
| addr | Return the resolved [[hostmask]] address
| ip | Return [[IP Address]]
+
| ip | Return the [[IP Address]]
| nick | Return nicknames resolved from a [[/dns command - mIRC|DNS]] lookup
+
| nick | Return the nicknames used when {{mIRC|/dns}}'ing on a nickname
 
}}
 
}}
  
Line 20: Line 21:
 
<source lang="mIRC">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.)</source>
 
<source lang="mIRC">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.)</source>
  
The above example makes use of multiple [[$iif identifier - mIRC|$iif identifiers]] to ensure that we get proper results, without unforeseen issues. The first surrounding [[$iif identifier - mIRC|$iif identifier]] checks to make sure any data has been returned. If no data is returned, then the [[/dns command - mIRC|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 - mIRC|$iif identifier]] checks to see if a '''.nick''' value can be extracted from the [[$dns identifier - mIRC|$dns identifier]]. This is filled if a nickname was the target of the [[/dns command - mIRC|DNS]] request. If the nickname is filled, return the portion containing the nickname. If, however, the nickname is not present, present only the [[Hostmask - IRC|hostmask]] and [[IP address|IP address]].
+
The above example makes use of multiple {{mIRC|$iif}} to ensure that we get proper results, without unforeseen issues. The first surrounding {{mIRC|$iif}} checks to make sure any data has been returned. If no data is returned, then the {{mIRC|/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 {{mIRC|$iif}} checks to see if a '''.nick''' value can be extracted from the {{mIRC|$dns}} identifier. This is filled if a nickname was the target of the {{mIRC|/dns}} request. If the nickname is filled, return the portion containing the nickname. If, however, the nickname is not present, present only the [[Hostmask - IRC|hostmask]] and [[IP address|IP address]].
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v6.0
+
{{mIRC compatibility|6.0}}
 
 
Added On: 03/02/2002
 
  
 
== See Also ==
 
== See Also ==
 +
* {{mIRC|/dns}}
 
* [[On dns - mIRC|ON DNS]]
 
* [[On dns - mIRC|ON DNS]]
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
  
[[Category:MIRC identifiers]]
+
[[Category:mIRC identifiers|dns]]

Latest revision as of 11:37, 18 February 2024

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


Synopsis[edit]

$dns(N)[.property]

Parameters[edit]

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

Properties[edit]

addr Return the resolved hostmask address
ip Return the IP Address
nick Return the nicknames used when /dns'ing on a nickname

Example[edit]

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 to ensure that we get proper results, without unforeseen issues. The first surrounding $iif 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 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[edit]

Added: mIRC v6.0
Added on: 03 Feb 2002
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also[edit]

[Expand]
v · d · e mIRC identifier list