mIRC Home    About    Download    Register    News    Help

Print Thread
#61587 23/11/03 09:45 PM
Joined: Sep 2003
Posts: 7
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Sep 2003
Posts: 7
Currently the way mirc handles dns pools it will pick 1 ip out of the pool and stick to it, so if it fails to connect instead of picking another ip it throttles the same ip again and again.

example

irc.network.com

127.0.0.1, 127.0.0.2, 127.0.0.3

ok lets say 127.0.0.2 server goes down and mirc has picked that ip.

The user would get the impression the network is down as the user would keep getting connection refused message instead mirc could simply move to another ip address in the pool and connect ok.

Could mirc be made to handle this differently so on every connect attempt it looks up the address and picks the ip out, perhaps this is linked to the /dns command that only outputs 1 ip hence the problem.

Joined: Nov 2003
Posts: 3
M
Self-satisified door
Offline
Self-satisified door
M
Joined: Nov 2003
Posts: 3
Code:
on *:DNS:{
  var %n = $dns(0)
  if (%n == 0) { echo 6 * Unable to resolve $naddress }
  while (%n > 0) {
    if ($dns(%n).addr == $naddress) { echo 6 $chr(91) $+ $asctime(HH:nn) $+ $chr(93) * Resolved $naddress to $dns(%n).ip } 
    elseif ($dns(%n).ip == $naddress) { echo 6 $chr(91) $+ $asctime(HH:nn) $+ $chr(93) * Resolved $naddress to $dns(%n).addr }   
    dec %n
  }
  echo 13 -
  HALT
}

Add this script to remote and you got it smile

[01:06] * Dns resolving www.microsoft.com
-
[01:06] * Resolved www.microsoft.com to 207.46.134.221
[01:06] * Resolved www.microsoft.com to 207.46.134.189
[01:06] * Resolved www.microsoft.com to 207.46.134.157
[01:06] * Resolved www.microsoft.com to 207.46.249.221
[01:06] * Resolved www.microsoft.com to 207.46.249.189
[01:06] * Resolved www.microsoft.com to 207.46.249.29

Joined: Sep 2003
Posts: 584
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Sep 2003
Posts: 584
i find it better to use code of Codemastr, since yours just spams a screen with multiply rows....

code:

ON *:DNS:{
if ($dns(0) == 0) {
echo $color(other) -ts Unable to resolve $iif($iaddress,$iaddress,$dns(0).addr)
}
else {
var %numhosts $dns(0), %host = 0
var %hosts
while (%host < %numhosts) {
inc %host 1
set %hosts %hosts $iif($dns(1) == $dns(1).ip,$dns(%host).addr $+([,$ccode($dns(%host).addr),]),$dns(%host).ip) $+ $chr(44)
}
echo $color(other) -ts Resolved $dns(1) to $left(%hosts,$calc($len(%hosts)-1))
}
halt
}


Result:

Resolved www.microsoft.com to 207.46.134.157, 207.46.134.189, 207.46.134.221, 207.46.249.29, 207.46.249.189, 207.46.249.221

and all you get in 1 line.

all credits goes to Codemastr http://www.unrealircd.com

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Whichever code you prefer, this isn't what the OP was referring to...

Joined: Apr 2003
Posts: 85
K
Babel fish
Offline
Babel fish
K
Joined: Apr 2003
Posts: 85
the script demonstrates that dns in mIRC does in fact work as it should. DNS caching at the DNS server can also cause this to be "stuck" with one IP.

[19:15] * Dns resolving irc.efnet.net
-
[19:15] * Resolved irc.efnet.net to 204.92.73.10
[19:15] * Resolved irc.efnet.net to 198.175.186.5
[19:15] * Resolved irc.efnet.net to 194.109.129.220
[19:15] * Resolved irc.efnet.net to 193.163.220.3
[19:15] * Resolved irc.efnet.net to 66.150.99.99
[19:15] * Resolved irc.efnet.net to 65.77.140.140
[19:15] * Resolved irc.efnet.net to 65.57.234.3
[19:15] * Resolved irc.efnet.net to 64.156.25.83
[19:15] * Resolved irc.efnet.net to 63.98.19.244
[19:15] * Resolved irc.efnet.net to 63.98.19.242
[19:15] * Resolved irc.efnet.net to 217.17.33.10
[19:15] * Resolved irc.efnet.net to 216.32.207.207
[19:15] * Resolved irc.efnet.net to 208.178.231.190


--

katsklaw
Rather experienced Admin
Rather experienced mIRC Scripter
Amateur C Coder

Link Copied to Clipboard