Enable query type PTR for a local addresses IP in Bind forwarding DNS server.

Bind creates the “empty zones” by default. So, that is why the reverse DNS (the query type PTR) lookup does not work for a local addresses IP.
Define “empty-zones-enable no;” in named.conf this will work as you expect.

Also you can created reverse map zone for your local machines, for example:

zone "16.172.in-addr.arpa" IN {

type forward;
forwarders {172.16.53.50; 172.16.53.51; 172.16.53.52;};
forward only;
};

Limiting the Memory a Name Server Uses.

To limit the amount of memory a name server uses, use the max-cache-size options statement:

root# cat /etc/named.conf
options {
directory "/var/named";
max-cache-size 10m; // maximum cache size of 10MB
};

root#

This tells the name server to remove old, cached records early (i.e., before they’re stale) if the size of the cache reaches the limit.
Once this is set, you may also want to reduce the cleaning interval (the period at which the name server checks for stale records):

root# cat /etc/named.conf
options {
directory "/var/named";
max-cache-size 10m; // maximum cache size of 10MB
cleaning-interval 10; // clean cache every 10 minutes
};

root#

Also the following can be used the max-cache-ttl and max-ncache-ttl. These limit the time-to-live values of cached records and cached negative responses, respectively.

root# cat /etc/named.conf
options {
directory "/var/named";
max-cache-size 10m; // maximum cache size of 10MB
cleaning-interval 10; // clean cache every 10 minutes
max-cache-ttl 60; // limit cached record to a 60s TTL
max-ncache-ttl 60; // limit cache negative responses to a 60s TTL
};

root#

To disable caching, see this: Bind – disable caching

Bind – Disabling Caching

To disable caching on a name server, use the recursion options statement:

root# cat /etc/named.comf
--cut
options {
directory "/var/named";
recursion no;
};
--cut
root#

Disabling recursion is one of the most effective ways to limit the amount of memory a name server uses.
Processing a recursive query often requires a name server to query another name server, and the name server then caches the response.
It’s caching that causes a name server’s memory usage to increase over time.
Unfortunately, you can’t disable recursion on just any old name server.
Many name servers serve one or more authorized resolvers, and those resolvers need their recursive queries answered, well, recursively.
Name servers used as forwarders must process recursive queries, too.

Forward queries for certain domian names to another name server.

Use a zone statement of type forward to tell a BIND server to forward queries for domain names that
end in the specified suffix to particular name servers. For example:

zone "domian.com" {
type forward;
forwarders { 172.16.12.100; };
};

This tells the name server to forward queries for domain names that end in domain.com to the name server at 172.16.12.100

Flush caching BIND (DNS cache)

All you have to do is restart bind to clear its cache:

root# /etc/init.d/named restart

You can also use rndc command as follows flush out all cache:

root# rndc restart

or

root# rndc exec

BIND v9.3.0 and above will support flushing all of the records attached to a particular domain name with rndc flushname command.

root# rndc flushname domain.name.com

It is also possible to flush out BIND views. For example, lan and wan views can be flushed using the following command:

root# rndc flush lan
root# rndc flush wan

Find out the subdomains of a given name with "dig"

You might find yourself in a situation that you would like to know all the listed sub-domains in a domain. If you are the administrator of the DNS server you will not have much trouble of finding the information, if you are not the administrator of the server you can have a hard time finding out the sub-domains for a domain.
First, find out the name server or servers for a domain using the dig command:
Continue reading “Find out the subdomains of a given name with "dig"”