/server -m 0.0.0.0 +9031 -i nick alt -jn #chan1,#chan2,#chan3,$chan4 *,key2,*,key4

Works for me using "*" for channels that don't have a key.