Im on a Network with many servers

if im one irc.network1.com

and someone else is on irc.network2.net

how do i get a var to get a users server they are on in the network

so i can do a command it would enter irc.network2.net into the var