While quering my authoritative-name-server (implemented with bind locally in VM) for "A" record of "host1.cool.com", it internally resolves the query using recursion (maybe) and returns with the actual "A" record. I need the nameserver to reply with one CNAME record each query, the recursive resolver can issue multiple dns query to resolve the name. But, I have not been able to do that with setting "recursion no;" to "named.conf.options".
My query (from another machine):
dig A @192.168.0.115 host1.cool.com
Response is the whole CNAME chain, and the final answer:
;; ANSWER SECTION:
host1.cool.com. 5 IN CNAME host2.cool.com.
host2.cool.com. 5 IN CNAME host3.cool.com.
host3.cool.com. 5 IN CNAME host4.cool.com.
host4.cool.com. 5 IN CNAME host5.cool.com.
host5.cool.com. 5 IN CNAME host6.cool.com.
host6.cool.com. 5 IN CNAME host7.cool.com.
host7.cool.com. 5 IN A 22.33.44.55
I want the nameserver to respond with just one CNAME record even for the "A" query. Maybe something like this:
host1.cool.com CNAME host2.cool.com
My named.conf.local file
zone "cool.com" IN {
type master;
file "/etc/bind/db.cool.com";
allow-transfer { none; };
};
And named.conf.options file
options {
directory "/var/cache/bind";
auth-nxdomain no;
allow-query { any; };
allow-transfer { none; };
recursion no;
};
db.cool.com file
@TTL 5S
@ IN SOA @ hostmaster.cool.com. (
0, 3H, 1H, 1W, 3H )
@ IN NS ns1.cool.com.
@ IN NS ns2.cool.com.
@ IN A 98.87.76.65
ns1 IN A 10.20.30.40
ns2 IN A 10.20.30.41
host1.cool.com. IN CNAME host2.cool.com.
host2.cool.com. IN CNAME host3.cool.com.
host3.cool.com. IN CNAME host4.cool.com.
host4.cool.com. IN A 22.33.44.55
How to configure bind not to internally use recursion to resolve the query?