When I've encountered this error in the past, it was typically a network configuration issue.
Is your Ubuntu machine's IP address statically or dynamically assigned, and can you access any other websites or machines on your LAN at all?
If it's statically assigned and you can't access anything else either on the internet or your LAN, check your configuration file
/etc/network/interfaces and try changing it from
iface (name) inet static to
iface (name) inet dhcp, and comment out all lines pertaining to that interface, then reboot to see if anything changes.
If you can access your LAN but not the internet, it's likely due to a DNS or default gateway misconfiguration. For a static connection, verify the
gateway xxx.xxx.xxx.xxx line of your
/etc/network/interfaces file. If your IP address is obtained through DHCP, it's likely a misconfiguration on your networking and not your host.