I don't think this will do what you think it will do. First, you'd want to echo, not cat, and second, the sudo won't affect the redirection, which is done by the shell.
I use "tee" for these scenarios.
echo "127.0.0.1 sourceforge.net" |sudo tee -a /etc/hosts