I can see you are a little confused by the commands...
Execute the command as I gave it
Code:
grep -i nameserver /etc/resolv.conf
Typing 'echo "yahoo 8.8.8.8" >> /etc/resolv.conf' won't result in any output, but will add a nameserver entry in /etc/resolv.conf and can be checked by the first command. I only suggested it because, if there is no namserver entry, then hostnames can't be resolved to IP addresses.
Can you ping the router IP address (gateway) successfully? For internet connectivity this is a must.