Quote
The DNS command that sometimes:
* /dns: not connected to server

is:
/dns -4 1.0.0.127.rbl.ircbl.org

I have not been able to reproduce this so far. Are you sure that something else in your script is not using /dns with the wrong parameters?