1

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?

1 Answer 1

0

This type of behaviour would break CNAMEs. If you don't want to get the IP-Address, you shouldn't query A/AAAA resource records (RRs), but ask the server explicitly for CNAME.

Quoting RFC 1034:

CNAME RRs cause special action in DNS software. When a name server fails to find a desired RR in the resource set associated with the domain name, it checks to see if the resource set consists of a CNAME record with a matching class. If so, the name server includes the CNAME record in the response and restarts the query at the domain name specified in the data field of the CNAME record. The one exception to this rule is that queries which match the CNAME type are not restarted.

For example, suppose a name server was processing a query with for USC- ISIC.ARPA, asking for type A information, and had the following resource records:

USC-ISIC.ARPA   IN      CNAME   C.ISI.EDU

C.ISI.EDU       IN      A       10.0.0.52

Both of these RRs would be returned in the response to the type A query, while a type CNAME or * query should return just the CNAME.

Recursion, in DNS-speak, is when your DNS server resolves names starting from the root zone, recursively descending zones until reaching the terminal label an querying the desired RR.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .