I want to have strong DNS cache server on my local host (server). So I need to change name server to my localhost.
How can I change it? byt this config it seems I must don't change it via editor so how can I change it?
root@asqar# cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 4.2.2.4 search asqar.net
I'm using
bind9
how can I set the DNS cache, any configure ?
If you want a DNS cache on your local machine, use dnsmasq, not BIND.
Unless you really need a local iterative nameserver, de-install BIND.
Now for dnsmasq. There are two ways of using dnsmasq.
1: If you are using NetworkManager to manage networking then you already have the dnsmasq-base package installed; you just have to enable the NetworkManager-controlled dnsmasq instance by editing
NetworkManager.conf
and ensuring that the line
is present. Next enable caching in this dnsmasq instance. Create a new configuration file called, e.g.,
local
and add the single line
to change the default cache size from zero. Then restart network-manager
which will also start or restart the NetworkManager-controlled dnsmasq instance using the new nonzero cache size.
This only works in Ubuntu 12.10 or later. In Ubuntu 12.04 the NetworkManager-controlled dnsmasq configuration cannot be customized and the cache size is zero.
2: The other way of using dnsmasq is to run it as a server. To do this, install the
dnsmasq
package and configure it by editing/etc/dnsmasq.conf
and settingcache-size
to a value greater than zero.In Ubuntu 12.10 the dnsmasq server will forward queries to external nameservers if the NetworkManager-controlled dnsmasq instance is disabled and will forward queries to the NetworkManager-controlled dnsmasq instance at the address 127.0.1.1 if the NetworkManager-controlled dnsmasq instance is enabled.
In Ubuntu 12.04 the same thing can be achieved but some additional manual configuration steps are required because in Ubuntu 12.04 the NetworkManager-controlled dnsmasq instance listens at 127.0.0.1 which conflicts with dnsmasq server in its default configuration.
this may be helpful, I don't think it will work as is on ubuntu but you should be able to adapt it easily.
reference : http://www.daemonforums.org/showthread.php?t=4471
or try this, seems more Ubuntu-centered : http://soledadpenades.com/articles/ubuntu/using-bind-as-a-local-caching-name-server/