In Linux (Ubuntu)
The instructions below are tested on Ubuntu. It works on other distributions that use Network Manager.
Go to System -> Preferences -> Network Connections . Some Wired tabs (or the Wireless tab if you're using a wireless connection). Highlight the active connection and click ' Edit '.
Go to the IPv4 Settings tab. Under the Method field, scroll down, select Automatic (DHCP) addresses only . Enter two ranges of 8.8.8.8 8.8.4.4 (separated by spaces) into the DNS Servers field.
Click OK to save. Now your Internet connection will automatically restart.
In Mac Snow Leopard
Go to System Preferences -> Network . Select the active connection and click the Advanced button.
Go to the DNS tab. In the left pane (DNS Servers), click the '+' button. Enter the '8.8.8.8 ″ range in the field. Add another entry to the '8.8.4.4 ″ range in this field.
Click OK.
That's all the work you need to do, wish you success!