Ferramentas de Usuário

Ferramentas de Site

Barra Lateral

Traduções para esta página?:

Debian 8 'Jessie' Server

Debian 7.0 wheezy Server


3.1.2 DNS Cache


To install bind9, a local DNS cache.

A caching only name server will find the answer to name queries and remember the answer the next time you need it. This will shorten the waiting time the next time significantly.


root@server:~# aptitude install bind9 bind9-doc dnsutils


To speed up and lighten the name resolution, we can use other DNS caches from outside servers as well. Usually ISPs provides DNS caches, but there are other DNS cache services available, claiming to be faster and safer, like:

Also, for security, our DNS server will only answer queries coming from internal addresses.

The configuration is stored in the file /etc/bind/named.conf.options:

options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        forwarders {
             // OpenDNS servers
             // ADSL router

        // Security options
        listen-on port 53 {;; };
        allow-query {;; };
        allow-recursion {;; };
        allow-transfer { none; };

        auth-nxdomain no;    # conform to RFC1035
        // listen-on-v6 { any; };

Check for possible syntax errors:

root@server:~# named-checkconf

Update /etc/resolv.conf, so DNS queries will be performed locally:


Also, /etc/nsswitch.conf, must look like this:

# [...]
hosts:	files dns
# [...]

Restart the DNS service:

root@server:~#  /etc/init.d/bind9 restart


Perform a forward lookup test:

root@server:~# nslookup www.debian.org

Non-authoritative answer:
Name:   www.debian.org
Name:   www.debian.org

A reverse lookup test:

root@server:~# nslookup

Non-authoritative answer:        name = bellini.debian.org.

Authoritative answers can be found from:
.       nameserver = c.root-servers.net.
.       nameserver = d.root-servers.net.
.       nameserver = h.root-servers.net.
.       nameserver = a.root-servers.net.
.       nameserver = m.root-servers.net.
.       nameserver = g.root-servers.net.
.       nameserver = f.root-servers.net.
.       nameserver = k.root-servers.net.
.       nameserver = i.root-servers.net.
.       nameserver = b.root-servers.net.
.       nameserver = l.root-servers.net.
.       nameserver = e.root-servers.net.
.       nameserver = j.root-servers.net.
a.root-servers.net      internet address =
b.root-servers.net      internet address =
c.root-servers.net      internet address =
d.root-servers.net      internet address =
e.root-servers.net      internet address =
f.root-servers.net      internet address =
g.root-servers.net      internet address =
h.root-servers.net      internet address =
i.root-servers.net      internet address =
j.root-servers.net      internet address =
k.root-servers.net      internet address =
l.root-servers.net      internet address =
m.root-servers.net      internet address =

Client configuration


Open the Internet Protocol Version 4 (TCP/IPv4) Properties dialog of the network adapter and type the IP address of our DNS server as the Preferred DNS server:


On Linux systems, just edit the /etc/resolv.conf file and add the IP address of our DNS server as the nameserver:

# [...]
# [...]

Automatic client configuration

DNS server address can also be automatically assigned using the DHCP protocol. In order to do this, just add the domain-name-servers option to the DHCP server configuration file /etc/dhcp/dhcpd.conf:

# [...]
option domain-name-servers;
# [...]


en/wheezy/intranet/dns/cache.txt · Última modificação em: 2020-08-02 20:10 (edição externa)

Ferramentas de Página