Flush DNS-Cache and change DNS-Server in Ubuntu

During i do today move a internet site from one server to another one, i’ve the problem that the DNS of this site isn’t up to date.
So i wanted to flush my local DNS cache, but how?

After a bit searching with google, i collect the needed informations for doing this in Ubuntu.
At first it’s needed to install nscd by using the following command:

sudo aptitude install nscd

After this, we are able to flush the DNS Cache with the following command:

sudo /etc/init.d/nscd restart

This should be enough, to become a current DNS dissolving. But in my case it shows after a few test, that our intranet router also caches the DNS. So, i must change my local DNS entry to another one, that is more up to date.

For this, we must editing the resolv.conf:

sudo nano /etc/resolv.conf 

Therein we must change the IP of the nameserver:

#nameserver 192.168.42.3
nameserver 208.67.222.222

After just a few seconds the system should be automatically changed, and your network requests goes to the new DNS server.

  1. No comments yet.

  1. No trackbacks yet.