Monthly Archives: January 2011

Speed your internet browsing on Ubuntu using local DNS Cache

Use these steps to speed your internet browsing requests on Ubuntu, by enabling local DNS cache :

1- Run this command to install dnsmasq package

sudo apt-get install dnsmasq

2- Modify the file :

sudo gedit /etc/dnsmasq.conf

change the line :


To :


3- Modify the file :

sudo gedit /etc/dhcp3/dhclient.conf

Ucomment the line :

prepend domain-name-servers;

4- Add the DNS to your connection through your connection manager

Your DNS servers should be :,,

5- Restart your connection

sudo /etc/init.d/networking restart

To check if it is working issue the following command twice:

dig | grep 'Query'

first response will be like :

;; Query time: 96 msec

run the previous command again

dig | grep 'Query'

Response now should be :

;; Query time: 0 msec

This will speed your browsing especially in pages with many HTTP requests.

Backup or Export, Compress and upload mysql database to remote host

This is a handy command that i use to backup or export, compress and upload a mysql database to my remote host, very handy when you wanna upload your development database to the remote host after some changes.

/usr/mysql/bin/mysqldump --opt -uUsername -pPassword Databasename  | gzip -c | ssh -q 'cat > ~/Databasename.sql.gz'

Replace the following :

  • /usr/mysql/bin/mysqldump : The path for mysqldump on your localmachine
  • Username : Username for local mysql database.
  • Password : Password for local mysql database.
  • Databasename : Name of the database to export.
  • : the user and the IP or the address of the remote host.

the above command will upload the compressed database to your home directory on the remote host, to change the directoy, replace ~/ with the path you want.