If you have a DNS problem, and it appears from what you posted you do, edit /etc/resolv.conf as root user. In Ubuntu use the 'sudo gedit /etc/resolv.conf' file and add the lines, so it looks like this:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
You can use the nameservers I am showing, they are there for anyone to use.
As an alternative, you can get the nameserver IP addresses form your service provider, and use them instead. Either should work.
If it does not, you will have to supply more information on your internet connection, your ISP, and hardware information.
You should restart your system after the edit.