Code:
alias gethost { .userhost $ | .enable #uh }
#uh off
raw 302:*:{
  set %uh $gettok($2,2,64)
  .disable #uh
}
#uh end

That code should work on all servers, there is a simpler way which you just need to use $address or $mask, but some servers won't let you do that, so yeah, that one should be good.