mIRC Homepage


Posted By: Wims

/dns - 22/12/16 04:33 PM

When the IP address passed to /dns does not resolve to an hostname, /dns reports that it resolved the ip to.. that ip.
/dns 2a02:214b:8125:8e00:bc56:8788:2655:52f3
[21:39:45] * Dns resolving 2a02:214b:8125:8e00:bc56:8788:2655:52f3
[21:39:45] * Dns resolved 2a02:214b:8125:8e00:bc56:8788:2655:52f3 to 2a02:214b:8125:8e00:bc56:8788:2655:52f3
If this is expected, then the help file should be updated.

Others strange things with /dns (try it on a connected server):

/dns ~westor@Swift-EAD07A2A.dsl.dynv6.forthnet.gr
[21:57:28] * /dns: no such user ~westor@Swift-EAD07A2A.dsl.dynv6.forthnet.gr
The help file says that if there is a ., it recognizes it as an hostname and try to resolve, so it shouldn't think it's an user here. Remove both the ~ and the @, and now mIRC try to resolve it as an hostname.

/dns aegeagjo@!@..
[22:02:34] * Dns unable to resolve address !@..
Basically recognizing email address and trying to resolve the domain, but none of this is documented, so that's a bug as far as I'm concerned.
Posted By: Khaled

Re: /dns - 26/01/17 08:45 PM

Thanks, the first issue has been fixed for the next version. The other issue is due to mIRC performing a basic check on the parameter to decide whether it is a hostname or a nickname. Since they can contain similar characters, mIRC just performs a very basic check for combinations of alphanumeric, ., and - characters. The routine does not check for !@ as it is only expecting a hostname or a nickname.
Posted By: Wims

Re: /dns - 27/01/17 01:03 AM

Right, I saw your original reply saying it was fixed and thought that would mean a '.' in the parameter would be taken as an hostname, but with you editing the post, I now take it the check performed isn't going to be fixed?
Posted By: Khaled

Re: /dns - 27/01/17 07:17 AM

I tested this and it seems to be working. If I /dns test and /dns test.com, it correctly treats the first as a nickname and the second as a hostname.

If the characters in the parameter are alphanumeric, include . or -, it is treated as hostname, otherwise it is treated as nickname.

Your example is a nickname!username@hostname combination, so mIRC cannot know whether you want it to use the nickname portion to resolve the address or the hostname portion. However, I could extend /dns to support this format and make it use the nickname by default, and if -h is used, to use the hostname. Is this what you are requesting?
Posted By: Wims

Re: /dns - 27/01/17 10:28 AM

It's correct for parameter such as "test" and "test.com" but the fulladdress format isn't being handled according to the description of the help file that's what bother me the most. I was thinking that if there is a . regardless of the format recognized, it would be taken as an hostname, for that reason, I think it should give priority to the hostname when a '.' is found, that's what I was requesting

/dns nickname!username@host.name - hostname
/dns nickname!username@hostname - user
/dns -h nickname!username@hostname - hostname

Of course that would break backward comp but that's fine for a buggy behavior imo.
Posted By: Khaled

Re: /dns - 27/01/17 10:59 AM

That's right, the /dns command has never supported a full address in a nickname!username@hostname format. When this feature was added, users requested that it resolve an address in the form of a hostname or look up the address from the server using a nickname.
Posted By: Khaled

Re: /dns - 28/01/17 11:10 AM

Right, I have extended /dns to support nick!user@host format. If /dns sees !@ characters in the parameter, it will parse it as a nick!user@host format and if there is a "host", with no wildcards, it will resolve it. If there is no "host" or it includes a wildcard, it will use "nick" to look up the host, unless there is no "nick" or "nick" includes a wildcard, in which case it will give up and use the whole parameter as a nick. This should maintain backwards compatibility with older scripts.
© 2020 mIRC Discussion Forums