Clear bind9 DNS cache and add additional forwarders for DNS lookup at Ubuntu

I moved 2 websites from one server to another server at the same hoster. The problem was my Ubuntu system that did not know the correct nameserver of this provider. To update the forwarders list of bind9, you have to add the nameservers to the following file:

/etc/bind/named.conf.options

You have to add the nameservers of your provider into the following array:

forwarders {
  nameserver-ip-of-you-provider-1;
  nameserver-ip-of-you-provider-2;
  any-other-nameserver-ip;
  any-other-nameserver-ip;
};

Finally, you have to restart the bind process:

sudo /etc/init.d/bind9 restart

Important: Do not just use sudo /etc/init.d/bind9 force-reload to restart the bind9 process.

Note: The TTL (time to live) of your record entries for your domain is mostly around 84600 seconds. If you want to move a website, you should reduce this value.

Comments

Thanks

Saved my day